A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

find week dates



 
 
Thread Tools Display Modes
  #1  
Old December 12th, 2004, 12:45 AM
external usenet poster
 
Posts: n/a
Default 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  
Old December 12th, 2004, 12:55 AM
external usenet poster
 
Posts: n/a
Default

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  
Old December 12th, 2004, 01:09 AM
PC Datasheet
external usenet poster
 
Posts: n/a
Default

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 11:15 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.