SQL Nominal Date Conversion [modified]
-
I currently have a table in SQL 2005 with two columns, one for Date, and one for Datetime. These are stored as nominal values, and is defined as the number of days since 12/30/1899, i.e. NOM_DATE 0 = 12/30/1899. Moment is defined as the number of minutes since 12/30/1899 12:00am (GMT), i.e. MOMENT 0 = 12/30/1899 12:00am. My question is how would I go ahead and convert these into actual dates like dd/mm/yy,using a stored procedure? Answer Found - Using DATEADD(days, Date, '18991230') worked.
modified on Thursday, August 25, 2011 10:24 AM
-
I currently have a table in SQL 2005 with two columns, one for Date, and one for Datetime. These are stored as nominal values, and is defined as the number of days since 12/30/1899, i.e. NOM_DATE 0 = 12/30/1899. Moment is defined as the number of minutes since 12/30/1899 12:00am (GMT), i.e. MOMENT 0 = 12/30/1899 12:00am. My question is how would I go ahead and convert these into actual dates like dd/mm/yy,using a stored procedure? Answer Found - Using DATEADD(days, Date, '18991230') worked.
modified on Thursday, August 25, 2011 10:24 AM
-
Since you have already found the solution, why not post it as an answer and mark it as answered?
You can only do that on the QA forums and not the general programming forums
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
-
You can only do that on the QA forums and not the general programming forums
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch