Necesito saber como transformo de fecha juliana a gregoriana en SQLServer.
tenía guardado este codigo de BPMargolin:
---
Julian date is actually a somewhat ill-defined term. Different people mean
it to mean different things. I'll assume you mean by a Julian date, a date
something like: 1999321 where the first 4 digits are the year, and the last
3 digits are the sequential day in the year. If so, then:
declare @Julian int, @Year int, @DayInYear int, @Gregorian datetime
select @Julian = 1999321
select @Year = @Julian / 1000
select @DayInYear = @Julian - 1000 * @Year
select @Gregorian = convert(datetime, 'Jan 1 ' + str(@Year))
select @Gregorian = DateAdd (d, @DayInYear, @Gregorian)
select Gregorian = @Gregorian
---
En siquelnet
(http://eu.webmatrixhosting.net/Eladio/default.aspx?Tema=MSSQL&Seccion=ARQ&A
rticulo=004.xml) tiene un enlace a una url que seguro que te es de utilidad
: ""The Julian and Gregorian Calendars" by Peter Meyer"
--
Saludos,
Eladio Rincón
MCP SQL Server
http://eu.webmatrixhosting.net/Eladio
"Comparte lo que sabes, aprende lo que no sepas". FGG
"Hector Carvajal" <hcar...@sonitel.com> escribió en el mensaje
news:#u4OBIHA...@TK2MSFTNGP12.phx.gbl...