dchinen
asked on
T-SQL Convert Julian Date to Standard Date Format
Hello,
Could someone tell me how what the syntax is to convert a Julian date to a regular date format in SQL? Thanks.
d-
Could someone tell me how what the syntax is to convert a Julian date to a regular date format in SQL? Thanks.
d-
http://home.capecod.net/~pbaum/date/injdimp.htm
http://home.capecod.net/~pbaum/date/injdalg.htm
Some good algorithms there.
http://home.capecod.net/~pbaum/date/injdalg.htm
Some good algorithms there.
And try this:
DECLARE @InputDate VARCHAR(30)
SET @InputDate = '2002365'
SELECT DATEADD(dd,CAST(RIGHT(@Inp utDate, 3) AS INT) - 1, '01/01/' + LEFT(@InputDate, 4))
AS [Result]
DECLARE @InputDate VARCHAR(30)
SET @InputDate = '2002365'
SELECT DATEADD(dd,CAST(RIGHT(@Inp
AS [Result]
ASKER
Wow, there is no built in T-SQL function for this? Okay, I'll try your suggestions. Thanks a million!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Sorry, read Julian Day Number rather than Julian Date Number.
Cheers
Cheers
ASKER
thanks, that's what i was looking for.
select NormalDate = dateadd ( dd , ( 2003200 % 1000 ) - 1 , convert ( datetime ,convert( char(4) , 2003200 / 1000 ) + '/01/01') )