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

Conditional Statements in Access

Status
Not open for further replies.

jvet4

Technical User
Jul 24, 2000
54
US
Is is possible for SQL queries in Access to contain IF...THEN statements.  If not what is the equivalent format in Access?
 
Yes, and no.<br><br>MS Access nor the Jet engine will accept IF...THEN statements in a query string. Access will <i>pre-process VBA functions</i> then pass that result on to the JET Engine with the text of the query itself.<br><br>So yes, you can use IF... THEN type logic, but only where it is enclosed in a function that returns a value, not directly in the query as litertal text.<br><br>Incidently, the <b>IIF function </b> is designed to provide IF...THEN logic flow and cam be used within a query . <p>Amiel<br><a href=mailto:amielzz@netscape.net>amielzz@netscape.net</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top