Solved

SQL Problem with Yes/No field in Access

Posted on 2006-07-23
3
222 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
Comment Utility
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:
mnasman earned 500 total points
Comment Utility
try

"and active = true"
0
 

Author Comment

by:ba272
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

763 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

11 Experts available now in Live!

Get 1:1 Help Now