Or you could do this:
SELECT If(flags & 0x0002, 'True', 'False') As Active,
If(flags & 0x0004, 'True', 'False') As Banned,
If(flags & 0x0008, 'True', 'False') As Delete
FROM mytable;
-----Original Message-----
From: Paul DuBois [mailto:paul@stripped]
Sent: Monday, August 23, 1999 5:22 PM
To: Steve Smith; myodbc@stripped
Subject: Re: MS Access & bits
At 6:08 PM -0400 8/23/99, Steve Smith wrote:
>Hi there,
> I have a MySQL table that has a integer type called 'flags'. 'flags'
>is made up of several bit values like so:
>
>ID_ACTIVE 0x0002
>ID_BANNED 0x0004
>ID_DELETE 0x0008
>.
>.
>.
>and so on.
>
> I originally designed the database like this because I was
>programming the system in C and it made sense at the time. Problem now
>is, I have to make this table managable from Access. I have the table
>linked to MySQL via ODBC. Of course, the 'flags' column is always a
>integer that is unreadable by most humans. Is there a easy way to have
>Access or MySQL break this flags column down into multiple columns (one
>for each bit value)?
You might want to convert the column to a SET, which appears as a string,
but which uses bitmasks to represent set elements internally.
--
Paul DuBois, paul@stripped
---------------------------------------------------------------------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail myodbc-thread606@stripped
To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail myodbc-unsubscribe@stripped instead.