How do I convert Julian date 286 to Oct 12 in Access form

M

maimiek

Extracting the julian Mont/Day from a barcode. I want to know how to turn
that into the mm/dd format on the form.
 
D

Dirk Goldgar

maimiek said:
Extracting the julian Mont/Day from a barcode. I want to know how to turn
that into the mm/dd format on the form.


By "julian", I take it you mean the day of the year, and you want to convert
that to a month/day-of-month format.

You can't actually do that accurately without knowing what year is
referenced, since some years are leap years and some are not. If the
current year is implied, you can use an expression like this:

=DateAdd("d", [YourJulianDayField], DateSerial(Year(Date()), 1, 0))

If the current year is *not* implied, but you have a control that holds the
year, you can reference that control in the expression:

=DateAdd("d", [YourJulianDayField], DateSerial(Year([YourYearField]), 1,
0))
 

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