On Wednesday 03 July 2002 12:55, Russ wrote:
> Hi all:
>
> Our company uses for reasons of experience, an INT(10) field for storing
> dates in a MySQL DB. ((We just DO OK! ;-))

I'm curious to know if there are any other reasons why your company doesn't 
store dates as dates. In absence of any other reasons, "For reasons of 
experience", seems to me to be saying "we're too lazy to change legacy code, 
we'd rather kludge something here and kludge something there and hope it all 
hangs together." :) Very similar to the way Windows is built -- and we all 
know how stable that is.

> However I it is because the date isn't stored as a DATE or DATETIME
> (etc) that I can't do an accurate ORDER BY <name_of_date_field> - as
> MySQL doesn't recognise the field's content as a valid date simply an
> integer (that we modify for display using PHP)
>
> Does anyone know of a way (kludge or otherwise) I may be able to perform
> such an ORDER BY, so that the dates in an HTML display table column are
> ordered AS dates while using an INT field format??

What format are your dates? If they are of the form 'YYYYMMDD' then ORDER BY 
should work.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *


/*
Marxist Law of Distribution of Wealth:
        Shortages will be divided equally among the peasants.
*/


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

Reply via email to