not evaluating True/False properly (1 Viewer)

Dylan Snyder

Registered User.
Local time
Today, 15:51
Joined
Dec 31, 2007
Messages
89
I recently added a bit field to an SQL table. The table already had bit fields in it before that worked properly. I added a new one. In access, when I run a query on it, no records are returned when I enter anything as a criterion. True, False, o, 1...doesn't matter. when I leave the criterion blank, all the records show. All other bit fields on this table work properly. has this happened to anyone else?
 

boblarson

Smeghead
Local time
Today, 13:51
Joined
Jan 12, 2001
Messages
32,059
In SQL Server the bit is 0 or 1, in Access False is 0 and True is -1 so you have to massage things a bit to get them to work together.
 

Dylan Snyder

Registered User.
Local time
Today, 15:51
Joined
Dec 31, 2007
Messages
89
Thanks, good to know
so simply adding True or False will no longer work? Oddly enough, it looks like it shows the appropriate records when I select Is Null.
 

boblarson

Smeghead
Local time
Today, 13:51
Joined
Jan 12, 2001
Messages
32,059
Have you tried just using

False

or

Not False
 

Dylan Snyder

Registered User.
Local time
Today, 15:51
Joined
Dec 31, 2007
Messages
89
yep---Is Null and Is Not Null work for True and False. I'm thinking maybe I should get back into enterprise manager and delete/add the field again.
 

boblarson

Smeghead
Local time
Today, 13:51
Joined
Jan 12, 2001
Messages
32,059
I would just add it as a small integer and then storing 1 or -1 or 0 won't matter.
 

Dylan Snyder

Registered User.
Local time
Today, 15:51
Joined
Dec 31, 2007
Messages
89
thanks,
So I can change to small integer and then set it up as True false in Access and it will accomplish what I'm trying to do? I have set up many bit fields and they appear to work. I guess the server picked this one to mess up.
 

boblarson

Smeghead
Local time
Today, 13:51
Joined
Jan 12, 2001
Messages
32,059
Yes, we are currently doing that on a job I am working on and it works fine.
 

Dylan Snyder

Registered User.
Local time
Today, 15:51
Joined
Dec 31, 2007
Messages
89
Thanks for your help. I'll just change to small integer and all should be well. Thanks!
 

Dylan Snyder

Registered User.
Local time
Today, 15:51
Joined
Dec 31, 2007
Messages
89
I tried to improve your rep but I guess you helped me last time on a project so I can't. Thanks nonetheless
 

boblarson

Smeghead
Local time
Today, 13:51
Joined
Jan 12, 2001
Messages
32,059
I tried to improve your rep but I guess you helped me last time on a project so I can't. Thanks nonetheless

Yeah, you'll have to give out rep points to at least 10 (I believe) different people before you can give it to the same person again. Hey, but when you have, feel free to come back and give me more :D
 

Users who are viewing this thread

Top Bottom