View Full Version : Julian Date


Daveillo
12-29-2009, 02:48 AM
Hi,

I'm currently working on a query and i need to compare a Julian date to todays date. The easiest way I guess to do this is convert now() to Julian as the query will be run regularly. Can anybody help?

Thanks

Dave

Pari
12-29-2009, 03:25 AM
Dave,

I am also currently looking at this issue. If it helps there is actually a test table with all the Julian dates as well as bank holidays etc in the download sample database section.

Regards. Pari.

raskew
12-29-2009, 03:49 AM
Hi -

I'm curious as to your definition of 'julian date'. If you did a Google on the term, you'd find it represented as a
7,980-year cycle that began on January 1, 4713 BC'. However, most times when a reference is made to
it nowadays, e.g. military usage, it refers to some version of the day of the year.

If that's the case, the following will return the day of the current year (today is 29 Dec 2009):

From the debug (immediate) window:
? val(Format(date() - DateSerial(year(date()) - 1, 12, 31), "000"))
363

HTH - Bob

Daveillo
12-29-2009, 04:02 AM
Hi Bob,

Today in the Julian date format i'm working with would be 109363.

Thanks

Dave

raskew
12-29-2009, 04:22 AM
Hi -


Today in the Julian date format i'm working with would be 109363

The 09 and 363 are obvious, but what does the 1 indicate?

Bob

Daveillo
12-29-2009, 04:31 AM
The 1 stands for the century, i.e 2000 is the 1st century. From 2100 will then begin with 2 and so on...

raskew
12-29-2009, 04:54 AM
Personally, I have never understood the desire to use the 'julian date', particularly with all the date-related functions available in Access.

Having said that, the use of 1 to indicate the 21st century is surely not self-explanatory. Could I suggest, as an alternative:

? val(year(date()) & Format(date() - DateSerial(year(date()) - 1, 12, 31), "000"))
2009363

Bob