OK, so I have a load of records in a table and they have many different dates. I want to retern only those records whose date falls on the last day of whatever quarter it's in.
I.e. I basically need the equivalent of a lastDayOfQuarter(date)
function that calculates the date that is the last day in the quarter for the date passed to it.
e.g. lastDayOfQuarter(#16/05/2013#) = #30/06/2013#
My query might look like:
SELECT * FROM mytable
WHERE mytable.rdate = lastDayOfQuarter(mytable.rdate);
This query will be run over PDO so no VBA allowed. Native MS Access only. I would also prefer to not use string manipulation as there is a difference between US and EU dates which might cause issues down the line.
WHERE Month(m.rDate) In(3,6,9,12)
to the query in the accepted answer to this question: stackoverflow.com/q/17830458/77335 Nice teamwork there, Harry. :-) – HansUp