Using Format Property to set fixed decimals

M

mrl

In a select query, I want to set the results of a formula to a return a fixed
decimal value. The formula is 7500D: Format(IIf([H7500]-[C7500]<0.005 Or
[H7500] Is Null,Null,([H7500]-[C7500])/[H7500]),".000"). The resulting query
data sheet displays the results properly as a 3 digit decimal, but when I
export to an Excel spreadsheet, the value appears to be formatted as text and
the format cannot be changed to any form of numeric.

Can I change the Format Proprty command above to return a value that will
export as a fixed decimal instead of text?
 
J

John Spencer

The use of the format function turns the result into a string. You might
consider use the round function to truncate the result to three decimal places.

You might try
7500D: IIf([H7500]-[C7500]<0.005 Or [H7500] Is Null, Null,
Round((([H7500]-[C7500])/[H7500]),3))

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top