Query by current and previous date

mariko

New Member
Joined
Jun 18, 2004
Messages
32
Hello!

I have a table in access that has weekly data all the way from the beginning of the year. But I only want a query to show the last two weeks of data, not the entire year (current week is last week's data and previous week is week before last). Is there a formula for this that I can enter into the criteria for the date field? I will keep appending weekly data which why I need a formula rather than change the query every week. I hope this makes sense. Any help would be great appreciated!!! Thanks in advance.

:rolleyes:
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
hi,

something like

Between Date()-x And Date()-y

where y is the end date & x is the start date required
depending on when you run the query...

eg if you run it the next day you would enter:

Between Date()-15 And Date()-1

or after a weekend

Between Date()-17 And Date()-3

etc

HTH
 
Upvote 0
I would run the query after the weekend, so the second equation will work fine. Thank you so much! :biggrin:
 
Upvote 0

Forum statistics

Threads
1,221,827
Messages
6,162,202
Members
451,752
Latest member
freddocp

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top