Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query to return 2 decimal points

Status
Not open for further replies.

douggy

Technical User
Jan 18, 2001
78
GB
hi there,

how can I alter this query to force two decimal points in the resultant figure.

Margin: IIf([Margin Value]>0,[Margin Value]/[Sales Value],0)

I can do it by setting the field property in the query designer, however I want to force it in the query.

Is this possible.

Thanks
Mark
 
I don't normally format in a query. This should generally be performed in the control on your form/report that displays the value.
Try:
Code:
Margin: Format(IIf([Margin Value]>0,[Margin Value]/[Sales Value],0),"0.00")
The result will be a text value rather than numeric.

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top