[dba-VB] Wha's up with True?

Dan Waters dwaters at usinternet.com
Sun Mar 28 08:24:39 CDT 2010


Hi Gustav,

What is MyBooleanOrBitField?

Dan

-----Original Message-----
From: dba-vb-bounces at databaseadvisors.com
[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Gustav Brock
Sent: Saturday, March 27, 2010 5:19 PM
To: dba-vb at databaseadvisors.com
Subject: Re: [dba-VB] Wha's up with True?

Hi John

That is in Access, right? As I've understood it, 1 and 0 _are_ true and
false in SQL Server and preferred to "True" and "False". In Access, true is
- as you know - numerically displayed as -1. 
I've made it a habit when working with numeric values for True and False to
use Abs([MyBooleanOrBitField] to avoid further thinking about this and to
make SQL code easier to move between SQL Server and Access.

/gustav

>>> jwcolby at colbyconsulting.com 27-03-2010 23:06 >>>
Any idea why it displays as -1?

John W. Colby
www.ColbyConsulting.com 


Gustav Brock wrote:
> Hi John
> 
> It is 1 that is True.
> 
> /gustav
> 
>>>> jwcolby at colbyconsulting.com 27-03-2010 22:39 >>>
> I am working on my billing database which holds the data in SQL Server.  I
have a bit field and 
> while it shows a value of -1, if I try to do a == -1 it filters out
records.  If I try == True it 
> pukes.  I have to do a <> 0 which returns records where that bit is set
(true).
> 
> So bit fields are not True / False?  What "value" is it?  And why does it
display -1 but I can't 
> test for that?
> 
> TIA



_______________________________________________
dba-VB mailing list
dba-VB at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-vb
http://www.databaseadvisors.com




More information about the dba-VB mailing list