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!

Yes/No Data Type

Status
Not open for further replies.

mbutler55

Instructor
Feb 5, 2003
33
US
Ok gurus -
In a field that is defined as "Yes/No" in Access, how do I make a comparison in ASP? Example:
sql = "SELECT INVEST, REF1CODE, NEWAC1 From AblProc WHERE REF1CODE='2AC20' AND NEWAC1='Yes';"

Having NEWAC1='Yes' gives "Data type mismatch in criteria expression." error message.
In the database the information is stored as -1 for Yes and 0 for No so I tried
sql = "SELECT INVEST, REF1CODE, NEWAC1 From AblProc WHERE REF1CODE='2AC20' AND NEWAC1='-1';"

That also gave the same error message.

Any help is GREATLY appreciated!
 
sql = "SELECT INVEST, REF1CODE, NEWAC1 From AblProc WHERE REF1CODE='2AC20' AND NEWAC1"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top