Jump to content

Archived

This topic is now archived and is closed to further replies.

tristeve

newbie date help

Recommended Posts

Hoping I can get some advice/pointers here. I've inherited a fairly basic MySQL where the date of an event is stored in 3 fields:

day [tinyint(2)] - example: 19
month [varchar(20)] - example: November
year [year(4)] - example: 06

I'm having no problems retrieving all events from the database, but I'd like to somehow sort them in ascending order from today's date.

Thanks in advance,

Steve

Share this post


Link to post
Share on other sites
<shudder>

Don't store dates that way...ever.  Use the native DATE / DATETIME column types, since you can extract individual pieces of the date if stored properly.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.