ba272
asked on
SQL Problem with Yes/No field in Access
Hi,
I have added a column to ab Access table called "Active" and it's a Yes/No field. It's part of my test environment so I can have completed records in the database that my program will ignore, until I check the checkbox to activate the record.
Oddly it works on some tables but not others. When running in "TestMode" I add the following to each line of SQL.
" AND Active=1";
In other words I'm appending one final condition to my WHERE clause. And like I said, it works on some tables but not others. Any ideas?
Thanks,
Bob
I have added a column to ab Access table called "Active" and it's a Yes/No field. It's part of my test environment so I can have completed records in the database that my program will ignore, until I check the checkbox to activate the record.
Oddly it works on some tables but not others. When running in "TestMode" I add the following to each line of SQL.
" AND Active=1";
In other words I'm appending one final condition to my WHERE clause. And like I said, it works on some tables but not others. Any ideas?
Thanks,
Bob
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
mnasman,
That worked. I had tried the following:
and active='true'
which didn't work as you'd expect, before I'd posted the question.
Thanks,
Bob
That worked. I had tried the following:
and active='true'
which didn't work as you'd expect, before I'd posted the question.
Thanks,
Bob
----------
if it works on some tables and not on others, then why not try to deubg to the sql and run that query in the access query window to see if it returns the records you expect it could be several things so testing the sql that comes out of your program in the query window is a way to find out if its in the code or in the table you try to access
----------
bruintje