Solved

SQL Problem with Yes/No field in Access

Posted on 2006-07-23
3
240 Views
Last Modified: 2010-04-16
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
0
Comment
Question by:ba272
3 Comments
 
LVL 44

Expert Comment

by:bruintje
ID: 17165857
Hi ba272,
----------

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
0
 
LVL 22

Accepted Solution

by:
Mohammed Nasman earned 500 total points
ID: 17165891
try

"and active = true"
0
 

Author Comment

by:ba272
ID: 17167387
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
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now