Pulling a date from a two digit year and julian date

Z

Ziggs

I have a field with an event number (EventNo). Example, 06-001-019.
06 is for the year, 001 represents the julian date for January 1st,
and 019 for the event of the day. My goal is to create a query that
will display the date of the event automatically based on the year and
julian date that's already in the EventNo. Any ideas? TIA
 
J

Jeff Boyce

Take a look at the DateSerial() and DateAdd() functions. It sounds to me
like you want to add the julian portion to the "zero-th" day of the year.
You can use the Left(), Mid() and Right() functions to extract the portions
you want.

--
Regards

Jeff Boyce
Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/
 
J

John Vinson

I have a field with an event number (EventNo). Example, 06-001-019.
06 is for the year, 001 represents the julian date for January 1st,
and 019 for the event of the day. My goal is to create a query that
will display the date of the event automatically based on the year and
julian date that's already in the EventNo. Any ideas? TIA

Assuming all your events are in this century, try

DateSerial(2000 + CLng(Left([EventNo], 2)), 1, CLng(Mid([EventNo], 4,
3))


John W. Vinson[MVP]
 
Z

Ziggs

Perfect!!!

I have a field with an event number (EventNo). Example, 06-001-019.
06 is for the year, 001 represents the julian date for January 1st,
and 019 for the event of the day. My goal is to create a query that
will display the date of the event automatically based on the year and
julian date that's already in the EventNo. Any ideas? TIA

Assuming all your events are in this century, try

DateSerial(2000 + CLng(Left([EventNo], 2)), 1, CLng(Mid([EventNo], 4,
3))


John W. Vinson[MVP]
 

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

Similar Threads


Top