March 1, 2004 at 3:19 pm
Good utilities are posted here to convert Calendar dates to Julian. Does anyone have a nice TSQL function to convert Julian dates to Calendar?
Depend upon it, sir, when a man knows he is to be hanged in a fortnight,
it concentrates his mind wonderfully."
Samuel Johnson
When the snows fall and the white winds blow,The lone wolf dies but the pack survives.
Once you've accepted your flaws, no one can use them against you.
March 1, 2004 at 3:58 pm
That works, but I need a 2 digit year in front.
When the snows fall and the white winds blow,The lone wolf dies but the pack survives.
Once you've accepted your flaws, no one can use them against you.
March 1, 2004 at 4:30 pm
Sorry that wasn't really necessary. Excuse the space.
When the snows fall and the white winds blow,The lone wolf dies but the pack survives.
Once you've accepted your flaws, no one can use them against you.
March 2, 2004 at 12:32 am
Amending noeld's post ... is this what you mean? I don't like 2 digit years! The coding works only for the 21st Century. It's fairly easily modified to handle a different 100 yr range (eg 1960-2059)
declare @Julian varchar(10) select @Julian = '04-213'
declare @lastdayprevyr datetime select @lastdayprevyr = dateadd(year,-1,convert(datetime,'31-Dec-20'+substring(@Julian,1,2)))
select dateadd(day,convert(int,substring(@Julian,4,99)),@lastdayprevyr) as stdDate
stdDate 2005-08-01 00:00:00.000
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply