>I have the day of the year and need to calculate the date. What is the best way to do this?
>
>I found this code to calculate the day of year - but nothing to reverse the day of year to a date.
>
>lnDays = ldMyDate - gomonth(ldMyDate, - month(ldMyDate) + 1) + day(ldMyDate)
>
>I'm sure I could set up a case statement for all the months and all the leap years. I was looking for a quickie!!
>
Try
ldDate = DATE(lnYear-1, 12, 31) + lnDays
ldDate = DATE(lnYear, 01, 01) + ( lnDays - 1 )
Whichever you prefer.
--sb--