day of year format

  • Thread starter Thread starter eaglewing
  • Start date Start date
E

eaglewing

Guest
I think there is an easy way to do this but not sure. I have a report with a date field. I have formated the field to "yyy". This gives the the two digit year and day of the year. What I need is the two digit year and day of the year, however I need all three place holders for day of year. For example 1 Jan 03, I need 03001. The current format gives 031. It does not show leading zero on day of year. Any suggestions of ideas as how to make this work?
 
i havent tried this but it may work
IIf(DatePart("y", [yourdate]) > 10, DatePart("yyy", [yourdate]), DatePart("yy", [yourdate]) & "0" & DatePart("y", [yourdate]))

it would be easier to test if you nth americans used proper date
formats like we aussies do
 
second thoughts
IIf(DatePart("y", [yourdate]) > 9, DatePart("yyy", [yourdate]), DatePart("yy", [yourdate]) & "0" & DatePart("y", [yourdate]))
 

Users who are viewing this thread

Back
Top Bottom