Working with DATE, TIME, TIMESTAMP in MS SQL!
I am working with a MSSQL 2000 database.
I am using PHP to display the table data. The table format (simplified) is as follows:
timekey, name, last_updated.
The timekey is in the following format:
I believe this to be in the MSSQL TIMESTAMP format.
The last_updated column is in the following format:
What I want to do is seperate the Time and Date from either one of these columns (at the database source) into seperate columns in their own right.
Thus allowing sorting of the table on Date or Time... i.e.
SELECT name, date, time FROM table ORDER BY date.
Anyone have any ideas? CAST or CONVERT? Im really stuck on this one..
Thanks in advance :)