Convert Julian Date to mm/dd/yyyy

  • Thread starter Thread starter K
  • Start date Start date
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.
 
Forgot to add my question. How can convert the julian date in a query to the
format 10/16/2009
 
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
 
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
 
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
 
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:
 
Back
Top