Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / April 2008

Tip: Looking for answers? Try searching our database.

Query that returns entries of only the current week (or two)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mewmew - 18 Apr 2008 02:50 GMT
I have a database that keeps track of an entry's date. In the query I need to
create an expression that returns only entries with an entry date in the
current calander week (rather than within the past 7 days).

Thanks!
Ken Snell (MVP) - 18 Apr 2008 03:26 GMT
Try this:

SELECT *
FROM TableName
WHERE EntryDate Between
DateAdd("d", 1-DatePart("w",Date(),1), Date())
AND DateAdd("d", 7-DatePart("w",Date(),1), Date());

Signature

       Ken Snell
<MS ACCESS MVP>

>I have a database that keeps track of an entry's date. In the query I need
>to
> create an expression that returns only entries with an entry date in the
> current calander week (rather than within the past 7 days).
>
> Thanks!
raskew - 18 Apr 2008 04:40 GMT
try:   ...between date() - weekday(date) + 1 AND  date() + 7 - weekday(date)

Bob

>I have a database that keeps track of an entry's date. In the query I need to
>create an expression that returns only entries with an entry date in the
>current calander week (rather than within the past 7 days).
>
>Thanks!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.