If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
find week dates
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 |
#2
|
|||
|
|||
never mind I think I found it
SELECT * FROM payments WHERE payment_duedate = Date() - WeekDay(Date()) + 1 AND payment_duedate = Date() - WeekDay(Date()) + 7 |
#3
|
|||
|
|||
Here's another way:
Put the following expression in a blank field in your query: WeekOfPaymentDueatePart("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 www.pcdatasheet.com wrote in message news 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 |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Find Dates Less Than 1 Year Old | Al H. | Running & Setting Up Queries | 2 | August 18th, 2004 05:53 PM |
decipher log of scanpst.exe | km | General Discussion | 0 | July 18th, 2004 09:00 AM |
Week number problem | Mike Collard | Running & Setting Up Queries | 2 | June 2nd, 2004 07:38 PM |
Work Week dates | GerryK | Worksheet Functions | 5 | January 9th, 2004 03:51 AM |