query field format

  • Thread starter Thread starter Cyndi
  • Start date Start date
C

Cyndi

I have a field in a query(that outputs to a report)

StudFeeDue:IIf([FinalStatus]="In-Foal],[Expr2],"0")
This works like a charm to return the values I want but will not let
me format it as Currency - all the fields in draws on are formatted
currency but it wont let me do it and if I go to the report and try
formatting the field there it still wont work.
Thanks
 
Drop the quote marks around the zero. They tell Access to interpret the
value as a string instead of a number:
StudFeeDue:IIf([FinalStatus]="In-Foal", [Expr2], 0)

To be more explicit, you could use:
StudFeeDue:CCur(IIf([FinalStatus]="In-Foal", Nz([Expr2],0), 0))
Explanation in article:
Calculated fields misinterpreted
at:
http://allenbrowne.com/ser-45.html
 
Back
Top