I know I could just try it, but then I'd have to create a table, fill it with data, and all that... I just want to know if you can order by date, but secondary by time. So January 1st, 2006 @ 10:00am would be before January 1st, 2006 @ 12:00am.
well actually I was asking if my question makes sense, but thanks. I'm not sure why, but I never even think to check the mysql manual. Any time I have a question about anything, I always check it's documentation first, but for some reason I never do that with mysql. Weird.
The Ninja Space Goat wrote:I know I could just try it, but then I'd have to create a table, fill it with data, and all that... I just want to know if you can order by date, but secondary by time. So January 1st, 2006 @ 10:00am would be before January 1st, 2006 @ 12:00am.
So there is no such table and you're free to choose the structure? Then why not using a single DATETIME field?
Why not have all those fields? A unix timestamp field would compliment year, month, date, hour, minute, second.. whatever! Don't oversimplify yourself into a corner!
Besides, most database records are write once / read many, so it would add less calculation overhead to generate these fields once on the way in then many times on the way out...
What's a few redundant bytes in your database compared to your mental health?
Kieran Huggins wrote:Why not have all those fields? A unix timestamp field would compliment year, month, date, hour, minute, second.. whatever! Don't oversimplify yourself into a corner!
Besides, most database records are write once / read many, so it would add less calculation overhead to generate these fields once on the way in then many times on the way out...
What's a few redundant bytes in your database compared to your mental health?
Cheers,
Kieran
unix timestamps are limited to dates > December of 1969... I need dates further back than that.
You could always use adjusted Julian dates. MySQL supports, that I remember a good range when using the separate types for date and time, so it should be fine there.