look at a date and return the following sunday

G

Guest

I need to show failures to meet target by week, with the last day of the week
being Sunday. So if a failure occurred on 07/08/06 I need to list it against
13/08/06.

Is there a neater way than If day = Monday add 6 days to date, if date =
Tuesday add 5 days to date?

Thanks
 
G

Guest

This gives you the numerical week of the year with Monday as the first day of
the week (Sunday as last day).

Format([YourDateField],"ww",2)
 
R

RoyVidar

steph said:
I need to show failures to meet target by week, with the last day of
the week being Sunday. So if a failure occurred on 07/08/06 I need
to list it against 13/08/06.

Is there a neater way than If day = Monday add 6 days to date, if
date = Tuesday add 5 days to date?

Thanks

Perhaps something like this

NewDate = MyDate - Weekday(MyDate, vbMonday) + 7

If you're thinking queries, the number represented by the vbMonday
constant, is 2
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top