find week dates

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to create sql that retrieves all records where the date in payment_duedate falls within the current week
sun. thru mon. I have never worked with weeks before and have looked everywhere for some help to no avail.
here's an example of what i'm trying to do, to give you an idea, but this doesn't work.
SELECT * FROM payments WHERE payment_duedate = (Now(), "ww")
thanks for the help
 
never mind I think I found it
SELECT *
FROM payments
WHERE payment_duedate >= Date() - WeekDay(Date()) + 1
AND payment_duedate <= Date() - WeekDay(Date()) + 7
 
Here's another way:

Put the following expression in a blank field in your query:
WeekOfPaymentDue:DatePart("ww",[PaymentDueDate])
Put the following expression in the criteria of that field:
DatePart("ww",Date())

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com


I would like to create sql that retrieves all records where the date in
payment_duedate falls within the current week
sun. thru mon. I have never worked with weeks before and have looked
everywhere for some help to no avail.
 

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

Back
Top