Julian date

  • Thread starter Thread starter George Sydney
  • Start date Start date
G

George Sydney

I am trying to add the julian date to my report. I want the program to take
the system date and convert it and display the julian date on the report.
Please can anyone help me?
 
Depends on what you mean by Julian Date.

If you're talking about the syntax where the date is represented as the day
of the year (i.e. today, 11 Dec, 2007 is day 345), you can simply use the
Format function (Format(Date, "y")) or DatePart function (DatePart("y",
Date)) (Note that the difference is Format returns a string, whereas
DatePart returns a number).

If you want to use 2007345 (or the less recommended 07345) to represent the
date, you'd use:

Format(Date, "yyyy") & Format(DatePart("y", Date), "000")

or

Format(Date, "yy") & Format(DatePart("y", Date), "000")
 
Thank you douglas.

I have inserted this into the control source of the text box of the report
im trying to create and when I run the report ms access prompts me for a date.
Can i possibly have the report automatically generate the julian date
without the prompt?

Would appreciate your help.

Thanks
--
George Sydney
Frustrated programmer


Douglas J. Steele said:
Depends on what you mean by Julian Date.

If you're talking about the syntax where the date is represented as the day
of the year (i.e. today, 11 Dec, 2007 is day 345), you can simply use the
Format function (Format(Date, "y")) or DatePart function (DatePart("y",
Date)) (Note that the difference is Format returns a string, whereas
DatePart returns a number).

If you want to use 2007345 (or the less recommended 07345) to represent the
date, you'd use:

Format(Date, "yyyy") & Format(DatePart("y", Date), "000")

or

Format(Date, "yy") & Format(DatePart("y", Date), "000")
 
Post what you put in the text box.
--
KARL DEWEY
Build a little - Test a little


George Sydney said:
Thank you douglas.

I have inserted this into the control source of the text box of the report
im trying to create and when I run the report ms access prompts me for a date.
Can i possibly have the report automatically generate the julian date
without the prompt?

Would appreciate your help.

Thanks
 
I have inserted the following in the text box

Format(Date, "yy") & Format(DatePart("y", Date), "000")

This produces the julian date BUT the report first prompts you with a date,
once you enter a date the report displays the julian date.

What i would like is the program to instantly produce a julian date without
the need to enter the date manually.

Would appreciate any assistance.

Regards George
 
Back
Top