OT: SQL null bit
Help, I'm going mad. (This is a 2 part question) SQL 2k, CF5.0 I have a db with a column defined as bit and I'd like to change null values to 0. But I can't find a way to select just the null values. SELECT COUNT(*) AS ct2 FROM table GROUP BY sw gives me three separate counts. Fine. But to count (and eventaully update) only where sw = null, I've tried: SELECT sw FROM table WHERE sw = cfqueryparam cfsqltype=cf_sql_bit null=yes WHERE sw != 0 AND sw != 1 WHERE sw 0 All return 0 records found. WHERE sw 1 Returns same as WHERE sw = 0 Second question. When checking directly against a database, date(timestamp) fields can be compared ok. But if I issue the same code against a Q-o-Q, I am getting errors. Is there some trick to Q-o-Q dates? Thanks in advance to any and all [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: OT: SQL null bit
Can't you use this? WHERE sw IS NULL -- Phillip B. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: OT: SQL null bit
At 10:06 AM 10/5/2004, you wrote: Second question. When checking directly against a database, date(timestamp) fields can be compared ok. But if I issue the same code against a Q-o-Q, I am getting errors. Is there some trick to Q-o-Q dates? Just a guess: against a DB requires ODBC compliant dates... Does against a QOQ require CF native formatted dates? Anders +===+ |Anders GreenEmail: [EMAIL PROTECTED] | |Home: 919.303.0218| |Off Road Rally Racing Team: http://linaracing.com/ | +===+ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
Re: OT: SQL null bit
IS NULL would be the correct syntax. Help, I'm going mad. (This is a 2 part question) SQL 2k, CF5.0 I have a db with a column defined as bit and I'd like to change null values to 0. But I can't find a way to select just the null values. SELECT COUNT(*) AS ct2 FROM table GROUP BY sw gives me three separate counts. Fine. But to count (and eventaully update) only where sw = null, I've tried: SELECT sw FROM table WHERE sw = cfqueryparam cfsqltype=cf_sql_bit null=yes WHERE sw != 0 AND sw != 1 WHERE sw 0 All return 0 records found. WHERE sw 1 Returns same as WHERE sw = 0 Second question. When checking directly against a database, date(timestamp) fields can be compared ok. But if I issue the same code against a Q-o-Q, I am getting errors. Is there some trick to Q-o-Q dates? Thanks in advance to any and all [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]
RE: OT: SQL null bit
That's it! *very red-faced* -Original Message- From: Phill B [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 05, 2004 10:18 AM To: CF-Talk Subject: Re: OT: SQL null bit Can't you use this? WHERE sw IS NULL -- Phillip B. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]