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

Writing 'IIf' query

Status
Not open for further replies.

camelk

Technical User
Mar 19, 2002
26
US
I need help writing an 'IIF' query. The field in my table is 'Title' and the person receives a '1' if an M.D. or '2' if a D.O. When I query the table, I want 'M.D' and 'D.O.' to show-up in the query, not '1' and '2'. I wrote:
Title: IIf([tblPhy]![PhyTitle]=1," M.D."," D.O.") but received #ERROR when the query ran. Help!! Thanks
camelk
 
Try using a . rather than !. Make sure the table and column name are spelled correctly.

IIf([tblPhy].[PhyTitle]=1,"M.D.","D.O.") Terry L. Broadbent - DBA
Computing Links:
faq183-874 contains "Suggestions for Getting Quick and Appropriate Answers" to your questions.
 
Terry,
I'm still getting the #ERROR msg. Any idea why?
camelk
 
Terry:
It's a very long query (25 flds). I'll just keep playing aroung with it. Thanks for your help.
camelk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top