Convert Julian Date to mm/dd/yyyy

K

K

Good day,

I have a query where the user enters the Julian date for example 09289 which
equates to 10/16/2009. 09 being the year and 289 being the number of days in
the year. Any help would be appreciated.

Thanks in advance.
 
K

K

Forgot to add my question. How can convert the julian date in a query to the
format 10/16/2009
 
V

vanderghast

DateAdd("d", 289, DateSerial( whichYear, 1, 0 ))


should return the date of the 289th day of the year whichYear.

So

( 09289 MOD 1000) + DateSerial( 09289 \ 1000, 1, 0)



should do.


(replace 09289 by the variable holding the NUMERICAL julian date, to be
generic)




Vanderghast, Access MVP
 
J

John Spencer

You could try using an expression like the following to do the conversion

DateSerial(Left([JulianField],2),1,Right([JulianField],3))

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
K

K

Worked. Thank you!!

vanderghast said:
DateAdd("d", 289, DateSerial( whichYear, 1, 0 ))


should return the date of the 289th day of the year whichYear.

So

( 09289 MOD 1000) + DateSerial( 09289 \ 1000, 1, 0)



should do.


(replace 09289 by the variable holding the NUMERICAL julian date, to be
generic)




Vanderghast, Access MVP
 
S

Sarah Vandrey

John, thank you for the excellent formula! It worked like a charm!
Good day,

I have a query where the user enters the Julian date for example 09289 which
equates to 10/16/2009. 09 being the year and 289 being the number of days in
the year. Any help would be appreciated.

Thanks in advance.
On Friday, October 16, 2009 9:10 AM K wrote:
Forgot to add my question. How can convert the julian date in a query to the
format 10/16/2009
"K" wrote:
On Friday, October 16, 2009 9:47 AM John Spencer wrote:
You could try using an expression like the following to do the conversion

DateSerial(Left([JulianField],2),1,Right([JulianField],3))

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

K wrote:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top