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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with If..Then..Else Statement

Status
Not open for further replies.

TamaraR

Technical User
Jan 7, 2002
6
0
0
CA
I am wondering if it is possible to use a If..The.. Else statement in a query to retrieve a calculated field number. I keep getting the error "The expression you have entered contains invalid syntax" " You may have entered an operand without an operator" whenever I try to run the Query.
Here is my expression:
Vapor Hg (ng/m3): If [Stop Hourmeter] = 0 Then [Vapor Hg (ng/m3)] = [Vapor Hg (ng/trap)] / [Total Flow (m3)] Else [Vapor Hg (ng/m3)] = [Ratio Cycle/Hour] * [Vapor Hg (ng/trap] / [Total Flow (m3)]

If anyone has an idea to help with this I would be very grateful.

Thanks,

Tamara
 
Look up the IFF command in the help. You can use that. Sorry, I don't have time to help more, but on my way out the door... Terry
**************************
* General Disclaimor - Please read *
**************************
Please make sure your post is in the CORRECT forum, has a descriptive title, gives as much detail to the problem as possible, and has examples of expected results. This will enable me and others to help you faster...
 
Thank you Terry, the IIf statement worked great. It solved my problems. I appreciate your help.

Tamara
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top