473,881 Members | 1,759 Online

# Calculate Weekending date.

Can someone help me with this. I need to calculate the week ending
date of the first week of the year based upon a year provided by the
user. Is there a simpler way other than writing my own UDF?
Jul 20 '05 #1
1 13142

"David" <da***********@ t-mobile.com> wrote in message
news:9a******** *************** ***@posting.goo gle.com...
Can someone help me with this. I need to calculate the week ending
date of the first week of the year based upon a year provided by the
user. Is there a simpler way other than writing my own UDF?

That depends on what week ending date and first week of the year mean.

If 1 Jan is on Wednesday do you want to come back with 4 Jan, 5 Jan, 11 Jan
or 12 Jan?

Anyway, Generally, the last day of a week is Date +7 - Day(Date) where Day()
returns the number of the day in the week (1=Sun, 2=Mon, 3=Tue,
etc...Assuming the week starts on Sunday)

However, if the datefield contains a time you may want to change the time if
you are using this in a comparison.

Regards,
Jim
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.