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!

If then statements in queries

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
In a select query, I want to generate a new field where every instance of a non-null value (from a text field) in field one is given the number 1 in the new field, and every instance of a null value in field one is given the number 0 in the new field. How and where do I construct this If, Then statement?
Thanks in advance - John
 

Select col1, IIf(isnull(col1),0,1) As NewCol
From table_name Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top