Solved

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

Posted on 2011-09-28
4
284 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 48

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 48

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

726 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