1-365

Wilder

New member
Local time
Today, 04:18
Joined
Feb 3, 2003
Messages
6
I need to automatically calculate the number of the day of the year (1-365) from a date entered by the user as mm/dd/yyyy. Any ideas? Thanks.
 
From the debug window (today is 9-Jun-03, your answer will vary depending on the date):

myDate = date()
Date2Julian = Format(myDate - DateSerial(Year(mydate) - 1, 12, 31), "000")
? Date2Julian
160
 
DatePart("y",[Enter a date])
 
Jon K.

Elegant solution! Confused me at first since I'd never used that brand of DatePart.

Bob
 

Users who are viewing this thread

Back
Top Bottom