Filter out current quarter's records from query

gojets1721

Registered User.
Local time
Today, 00:13
Joined
Jun 11, 2019
Messages
430
I have a query that looks at the last 2 years of records based on the 'SubmissionDate' field. Below is the SQL:

Code:
SELECT *
FROM qryAllComplaints
WHERE (((Year([SubmissionDate]))>=(Year(Date())-1)))
ORDER BY SubmissionDate;

I want to use this query as the source for a second one, but one where the current quarter's records are filtered out.

Any suggestions on how to code that?
 
Are we talking calendar or fiscal year? If fiscal, what is yours?
 
Calendar. So ideally, this query would filter out July 23, August 23, and Sept 23 records until it becomes Q4
 
SQL:
WHERE SubmissionDate < DateSerial(Year(Date()), DatePart("q",Date()) * 3 - 2, 1)
 
SQL:
WHERE SubmissionDate < DateSerial(Year(Date()), DatePart("q",Date()) * 3 - 2, 1)
And this will continue to work even when it turns to Q4 (i.e. Q4 will then be removed and Q3 will be included?)
 
And this will continue to work even when it turns to Q4 (i.e. Q4 will then be removed and Q3 will be included?)
To test it out, just replace Date() with an actual date value (properly delimited, of course).
 
Are you still thinking or are you already testing?
 

Users who are viewing this thread

Back
Top Bottom