[ic] Sorting by date

Paul Jordan interchange-users@icdevgroup.org
Tue Aug 27 13:18:01 2002


> Hi - i'm something of a newbie here so this might be a stupid question.
>
> I have a mysql database and am about to add a new table (or tables) to
> add news content to the website. The important thing is that i want to
> be able to sort news items by date.
>
> i know this is a basic problem but the undoubtedly simple solution is
> eluding me. if i store the date as a string with things like Jan and Feb
> in it and i sort alphabetically i wont get the results i want.
>
> i could store each value numerically and sort by year then month then
> day of the month then time but this seems an ugly way to go about it.
>
> I am running interchange 4.6.5.
>
> thanks in advance!
>
> John Allman


No, that is the best way. yyyymmdd is the way to go, then use [convert-date]

http://www.icdevgroup.org/cgi-bin/ic/docfly.html?mv_arg=ictags06%2e03




or the [time] tag

http://www.icdevgroup.org/cgi-bin/ic/docfly.html?mv_arg=ictags04%2e75


HTH

Paul