Solved

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

Posted on 2011-09-28
4
252 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
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 how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

743 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now