julian dates

G

Guest

Hi

Wondered if someone could help me. I am currently learning VB in Access and am trying to to set up a procedure to do the following
to read dates from a General Date field (i.e., 01/01/2004 00:00:01) in an access tabl
convert them to a yynnn julian date format (I realise this is not the true julian date format
and write them into the tabl

Any help would be much appreciated

Damia
 
D

Douglas J. Steele

Why write them to a table? You've already got the date there. Whether it's
2004-05-15 or 04136, it's still the same date.

DatePart("y", MyDate) will give you what day of the year it is (your nnn).
For that matter, so will Format(MyDate, "y") and you can use Format(MyDate,
"yyy") to get the 2 digit year followed by that number. Unfortunately,
Format(MyDate, "yyy") won't use 3 digit for nnn. To get that, try:

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

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


lidgardd said:
Hi,

Wondered if someone could help me. I am currently learning VB in Access
and am trying to to set up a procedure to do the following:
 

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