antiskeptic
Programmer
I am writing a stored proc with a few dates in the select statement (Using SQL Server 2000 / Query Analyzer).
Only problem is, the dates aren't really date fields. They are integers of 4 digit numbers that I have to go through a conversion to get the date I want. And the formula I have below takes care of it beautifully.
My problem comes when the integer format changes for a different field...giving me another type of date. This one is an 8 digit number rather than four, and is calculated in minutes rather than days. I tried this, thinking it would do the trick:
but it only gives me the time...not the day. Would anyone happen to know how I could get the date and time out of this? And if not time, just date...that is what I really need here. I'm goin nuts! *ha*
Thank you in advance for any help you can provide.
Sincerely,
Antiskeptic
Only problem is, the dates aren't really date fields. They are integers of 4 digit numbers that I have to go through a conversion to get the date I want. And the formula I have below takes care of it beautifully.
Code:
convert(datetime,(dateadd(day,employee_pay_period.Pay_Period_Ending_Date,'1/1/1930')))Pay_Period_End_Date
My problem comes when the integer format changes for a different field...giving me another type of date. This one is an 8 digit number rather than four, and is calculated in minutes rather than days. I tried this, thinking it would do the trick:
Code:
substring(convert( varchar, dateadd( mi, employee_pay_period.employee_signature_timestamp,
convert( datetime, '01/01/1930' ) ), 100 ), 13,6)
but it only gives me the time...not the day. Would anyone happen to know how I could get the date and time out of this? And if not time, just date...that is what I really need here. I'm goin nuts! *ha*
Thank you in advance for any help you can provide.
Sincerely,
Antiskeptic