Format Currency (1 Viewer)

daveyj

New member
Local time
Yesterday, 23:00
Joined
Jun 14, 2019
Messages
2
I have set the form field and the query field as currency, (or fixed) but the result is as a general number to many decimal places.
So i'm trying to format the "currency " in the number part of the expression below, but access tells me "Syntax error (comma) in the expression.

I'm trying to calculate a jobs recovery rate, but if the total time isn't entered, or the order value isn't entered there is a message, but if all is well a cost is returned.

ActRecRate: IIf([TotalTime]=0,"No Hrs Booked",(IIf([Order Value]=0,"No Order Value",(Format([Order Value]-[expr2])/[TotalTime])),"Currency"))
 

Minty

AWF VIP
Local time
Today, 07:00
Joined
Jul 26, 2013
Messages
10,371
You've got too many closing brackets, or not enough opening ones.
Format([Order Value]-[expr2])/[TotalTime])),"Currency")

I think this should be
Format((([Order Value]-[expr2])/[TotalTime]),"Currency")
 

daveyj

New member
Local time
Yesterday, 23:00
Joined
Jun 14, 2019
Messages
2
Minty, you star, I'd tinkered with the brackets, but not to that extent.
Below is what worked

ActRecRate: IIf([TotalTime]=0,"No Hrs Booked",(IIf([Order Value]=0,"No Order Value",Format((([Order Value]-[expr2])/[TotalTime]),"Currency"))))

Thankyou
 

Users who are viewing this thread

Top Bottom