Query - Formula needed to set it for a week date

reddd

New Member
Joined
Sep 12, 2018
Messages
2
Hi there,
I'm super glad to have found you all!
I am looking for a query much like this one -
Date()-Weekday(Date(),2)-56

I don't want it to be all the dates inside the 56. I just need the query to pull the Sunday from 13 weeks ago date data. Can that happen? I have a lot of different queries that need this info so I don't want to have to do this manually every time I pull a report on this.

Thanks for your help!
Reddd
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Welcome to the Board!

So, for today, would you want it to return June 10, 2018, or June 17, 2018?
You would just need to change the 56 (which represents 8 weeks) in your formula above to 91 (13 weeks) or 84 (12 weeks).
 
Last edited:
Upvote 0
try
=TODAY()-(WEEKDAY(TODAY(),2)+91)
 
Last edited:
Upvote 0
Create a function to return the date. I'll use your code to calculate the Sunday date, but change it if it does not produce what you want
Rich (BB code):
Public Function Sunday13() As date
Sunday13 = Date()-Weekday(Date(),2)-56
End Function


Then just call it from anywhere.
 
Upvote 0
try
=TODAY()-(WEEKDAY(TODAY(),2)+91)
TODAY() is a not a valid function in Access.
(guessing you didn't realize you were in the Access forum)
 
Upvote 0
TODAY() is a not a valid function in Access.
(guessing you didn't realize you were in the Access forum)

I miss it every time :), read the question, not the location
 
Upvote 0
Create a function to return the date. I'll use your code to calculate the Sunday date, but change it if it does not produce what you want
Rich (BB code):
Public Function Sunday13() As date
Sunday13 = Date()-Weekday(Date(),2)-56
End Function


Then just call it from anywhere.


THIS WORKS!
=Date()-Weekday(Date(),2)-91

Thank you! Thank you! Thank you for your help!
 
Upvote 0
THIS WORKS!
=Date()-Weekday(Date(),2)-91
That is what I was telling you to do up in the first reply (just change the 56 to 91), and even explained why!;)
 
Upvote 0

Forum statistics

Threads
1,214,929
Messages
6,122,317
Members
449,081
Latest member
tanurai

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