----- Original Message ----- From: "Diane Schips" <[EMAIL PROTECTED]>
> I'm in VB. I was originally using 'and'. I was/am comparing to a number - > it seemed that VB was changing the value of bit to a bool when I didn't want > it to. bit is defined as a long. > > Here's mu current string: > strSQL = "SELECT * FROM test WHERE (bit AND 1) = 1" A couple of things... may or may not help. (1) BIT is a reserved word in SQL, it's a data type consisting of a single bit of data. Almost certainly nothing to do with this situation, but a reminder that it's always best to avoid real words when picking variable names, 'bitValue' might have been safer... (2) You say 'bit is defined as a long'... maybe in the VB, but not in SQL it isn't. SQL has the following numeric data types: BIT (1 bit), DECIMAL or NUMERIC (fixed or floating point), FLOAT or NUMBER (floating point), INT or INTEGER (4-byte integer), REAL (4-byte floating point), SMALLINT (2-byte integer) and TINYINT (1-byte integer). What is the field 'bit' defined as in the database? If it's "number" then you are looking at a floating-point value where the bit positions are nothing like what you expect... ____ � The WDVL Discussion List from WDVL.COM � ____ To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] Send Your Posts To: [EMAIL PROTECTED] To change subscription settings to the wdvltalk digest version: http://wdvl.internet.com/WDVL/Forum/#sub ________________ http://www.wdvl.com _______________________ You are currently subscribed to wdvltalk as: [email protected] To unsubscribe send a blank email to [EMAIL PROTECTED]
