Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- yes/no data type
August 2, 2006, 11:57 am
rate this thread
Re: yes/no data type
I'm guessing it's an interpretation of the DAO or ADO database libraries
you are using with vbscript.
I presume that when you say "do the same query with mySQL", you are
referring to the MySQL command line client app. - yes/no ;-)
In MySQL, there is no real "boolean" flag attached to the field.
SELECT True; # MySQL returns then integer 1
SELECT False; # MySQL returns the integer 0
The fact is, "True" and "False" are simple constants reflecting the integers
1 and 0 respectively.
More specifically, 0 is False and any number<> 0 is True.
Boolean algebra, Linux, MySQL running under Linux, and (I presume!) MySQL
running under Windows all follow this convention consistently.
As far as the MySQL command client is concerned, one needs to coerce it to
display the words "True" or "False"
SELECT IF(fld<>0, "True", "False")
or if you prefer:
SELECT IF(fld<>0, "Yes", "No")
I don't *think* there is any way to get that to happen automatically in the
MySQL command line client the way you can in Access. If you have linked
tables or pass through queries in Access that are speaking with MySQL
tables - these will never see a field labeled "boolean". You will have to
corece the type using the SELECT IF statements shown above.
But - That's a display/user interface issue.
The logic works exactly the way you would expect.
- » Americanas.com SALDO de TVs Com at 80% de Desconto (29798)
- — Newest thread in » MySQL Database Forum