[PHP-DB] WHERE mydatestamp '2003-08-22 13:13:13'

2003-08-22 Thread Matt Babineau
Hey All-

I'm trying to find things in my database that are greater then Now(),
but the date is stored in a blob (don't ask, I know :-0). Is there a way
I can do that comparison to find things that are in the future?

Thanks, Matt


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] WHERE mydatestamp '2003-08-22 13:13:13'

2003-08-22 Thread CPT John W. Holmes
From: Matt Babineau [EMAIL PROTECTED]

 I'm trying to find things in my database that are greater then Now(),
 but the date is stored in a blob (don't ask, I know :-0). Is there a way
 I can do that comparison to find things that are in the future?

Option 1: Make a second column of DATETIME and UPDATE Table SET
datetime_column = blob_column and then drive on...

Option 2: Use the CAST() function... SELECT * FROM Table WHERE
CAST(blob_column AS DATETIME)  NOW()

Option 3: SELECT * FROM Table WHERE UNIX_TIMESTAMP(blob_column) 
UNIX_TIMESTAMP(NOW())

I'm sure there are more...

---John Holmes...


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php