using IF in a report or query

56th Rowallan

Registered User.
Local time
Today, 20:45
Joined
Jan 17, 2006
Messages
11
Hi I need help, badly

I have a report & query which needs a calculation performing if another field is set to "true" and cannot seem to get it to work.

EG total cost:= if [3rd party accedent]="true",([paint cost]+([labour rate]*[hours])+[parts cost]).

Please help I'm a newbie and I bet i've done something stupid

Thanks

Row
 
You need a part if it is false:
EG total cost:= if [3rd party accedent]="true",([paint cost]+([labour rate]*[hours])+[parts cost], PUT WHAT TO RETURN IF FALSE HERE)
 
In a query:

EGTotalCost: IIf([3rd party accedent]="true",([paint cost]+([labour rate]*[hours])+[parts cost]),0)

If that field is actually a yes/no field, drop the quotes around true.
 

Users who are viewing this thread

Back
Top Bottom