Solved

How Can My Query Return Only Items With a Date from "Last Week"?

Posted on 2011-09-28
4
268 Views
Last Modified: 2012-05-12
To make it easier, it already assigns a "week ending" date, so every record has a Saturday date. I just want to have the returns limited to the items with the date from "last Saturday"

I will run this query any day from monday to Friday of "This Week", but I always want it to ONLY show the results from last week.

Does that make sense? thanks.
0
Comment
Question by:Rex85
  • 2
  • 2
4 Comments
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 36719524
Where [Week Ending] = date() - weekday(Date(), vbSaturday)
0
 

Author Comment

by:Rex85
ID: 36719569
Fyed:

My WHERE clause looks like this...

WHERE ((CAR_Requests.Status)="Closed") And Where([Closed Date]=date()-weekday(Date(),vbSaturday))

I got an "Undefined Function in WHERE Clause" Error when trying to execute it. Did I do something wrong?

Thanks
0
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 500 total points
ID: 36719582
Try:

WHERE CAR_Requests.Status="Closed"
And [Closed Date]=date()-weekday(Date(),7))

If this is in a query, you will probably have to replace vbSaturday with the numeric value of 7
0
 

Author Closing Comment

by:Rex85
ID: 36719623
That worked! Thank you.

Rex
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question