Re: WHERE mydatestamp > '2003-08-22 13:13:13'
| From: | CPT John W. Holmes | Date: | Fri, 22 Aug 2003 22:05:06 +0000 |
| Subject: | Re: WHERE mydatestamp > '2003-08-22 13:13:13' | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-30065@lists.php.net to get a copy of this message | ||
From: "Matt Babineau" <matt@criticalcode.com>
> 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...