Solved Pulling records based on day of the week (1 Viewer)

sroot

Registered User.
Local time
Today, 05:06
Joined
Mar 18, 2013
Messages
53
I have a query that i need to pull all records from Monday through today. I figured out how to do most of it. i tried this ">Date()-Weekday(Date()-2)" The problem i come across is when i try to run it on Monday it pulls from last Monday and i would like it to only pull today. Is there any way to do that? Thanks!
 

Gasman

Enthusiastic Amateur
Local time
Today, 13:06
Joined
Sep 21, 2011
Messages
14,305
Use IIF() to test if a Monday and adjust accordingly?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 05:06
Joined
Oct 29, 2018
Messages
21,473
Just a thought but could you give this a try?
Code:
>=DateAdd("d",1-Weekday(Date(),2),Date())
 

Gasman

Enthusiastic Amateur
Local time
Today, 13:06
Joined
Sep 21, 2011
Messages
14,305
Also look at
Date()-(Weekday(Date())-2)

but test it throroughly as I would expect today to return today as the latter part returns 0?
 

Users who are viewing this thread

Top Bottom