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.
 
Back
Top