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

Putting IF statement in query to blank restricted info 1

Status
Not open for further replies.

Handford

Technical User
Oct 4, 2005
19
GB
I have a database of people and informaation about them (such as DOB). Each person is allowed to make thier information restricted so that it is not published in reports. I have go a Yes/No Feild called [Restricted Toggle] which records Yes if the information is to be restricted.

What I would like to produce is a query that has all peoples names but blanks out the field DOB for all that have toggled the [Restricted Toggle]. I have tried doing this by building a query in design view and writing an IF/ ELSE statement. However either this is not possible or my syntax is rubbish. Can you please help?

Thanks

Handford
 
you could put the following:

IIF([ToggleName] = 0, [DOB], Null) AS DOBRenamed


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top