Specific date query (1 Viewer)

mounty76

Registered User.
Local time
Today, 03:54
Joined
Sep 14, 2017
Messages
341
Hi All,

I'm trying to write a query that returns the below:

Between (24th of the last month) And (27th of the current month)

Is straight forward for the first and last days of the month but am struggling with the specific dates?

Any help much appreciated!

Cheers
 

mounty76

Registered User.
Local time
Today, 03:54
Joined
Sep 14, 2017
Messages
341
Sorry folks, managed to figure it out

Between DateSerial(Year(Date()),Month(Date())-1,24) And DateSerial(Year(Date()),Month(Date()),27)
 

Gasman

Enthusiastic Amateur
Local time
Today, 11:54
Joined
Sep 21, 2011
Messages
14,262
Perhaps mark it solved then?
 

plog

Banishment Pending
Local time
Today, 05:54
Joined
May 11, 2011
Messages
11,643
Would that solution have worked a week ago? Need to use DateAdd to future proof it.
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 03:54
Joined
Aug 30, 2003
Messages
36,125
Would that solution have worked a week ago? Need to use DateAdd to future proof it.

Looks like yes:

?DateSerial(Year(#1/26/22#),Month(#1/26/22#)-1,24)
12/24/2021
 

plog

Banishment Pending
Local time
Today, 05:54
Joined
May 11, 2011
Messages
11,643
Apologies. It does work without having to manually account for the year change backwards.
 

Users who are viewing this thread

Top Bottom