Day of the year

Results 1 to 2 of 2

Thread: Day of the year

  1. #1
    DF Guest

    Default Day of the year

    The DatePart function can be used to find what day of the year a specified date is ie 2-Jan = 2 day of year but if I&#039;ve got a number between 1 and 366 how do I find it&#039;s date I realise this is complicated because of leap year and so forth.<BR><BR>Thanks<BR>Dave

  2. #2
    Eddie Campbell Guest

    Default RE: Day of the year

    As long as you know which year it is you are working with, just use the DateAdd function to add the required number of days to the 1st Jan of that year.<BR><BR>E.g.<BR><BR>DayToFind = 65<BR>NewDate=DateAdd("d",DayToFind,"01/01/2001")<BR><BR>This will set NewDate to 7th March 2001 (65 days from 1st of Jan). It will also deal with leap years for you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts