How many dates this week?

C

Chris K

I need to count how many dates are within this/current week

i can identify this month (month(date())) but i dont know how to refer to
this week
 
J

John Spencer

Try restating your question. There are 7 days in every week.

If you mean you want the criteria to return any records with a date field that
match the current week, then the answer depends to some extent on how you
define the current week. Does it start on Sunday or Monday or some other day?
Assuming Sunday is the first day of the week, then use criteria like the
following.

Between DateAdd("d",-5-Weekday(Date(),1),Date()) AND
DateAdd("d",1-Weekday(Date(),1),Date())

If Monday is the first day of the week, then replace 1 with 2

You can also identify the week using the datePart function. Since you
probably want to distinguish by year also you would need to calculate the year
also.
DatePart("ww",somedate,1,3) & Year(SomeDate)

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
 

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