Re: WHERE mydatestamp > '2003-08-22 13:13:13'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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...


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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux