W Wilder New member Local time Today, 04:18 Joined Feb 3, 2003 Messages 6 Jun 10, 2003 #1 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.
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.
R raskew AWF VIP Local time Today, 07:18 Joined Jun 2, 2001 Messages 2,731 Jun 10, 2003 #2 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
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
J Jon K Registered User. Local time Today, 13:18 Joined May 22, 2002 Messages 2,209 Jun 10, 2003 #3 DatePart("y",[Enter a date])
R raskew AWF VIP Local time Today, 07:18 Joined Jun 2, 2001 Messages 2,731 Jun 10, 2003 #4 Jon K. Elegant solution! Confused me at first since I'd never used that brand of DatePart. Bob