From Newsgroup: comp.databases.ms-access
Hello
Checkout the DatePart function, which will return the quarter of any given date.
https://support.microsoft.com/en-us/office/datepart-function-26868a79-5505-4e5a-8905-6001372223fa
and you can use it in a query, or in vba.
This ugly example below would grab all records for the current financial year
SELECT tblImportantInfo.tblImportantInfoDATEField
FROM tblImportantInfo
WHERE (((DatePart("q",[tblImportantInfoDATEField]))=DatePart("q",Date())) AND ((Year([tblImportantInfoDATEField]))=Year(Date())));
If you form button is filtering the list to only show the current Qtr, you can just have a form field of
=Count(primarykey)
This page has some other examples around Quarters.
http://codevba.com/office/quarter_date_functions.htm#.X1Qls1Uzbcc
HTH
Mal.
On Saturday, September 5, 2020 at 6:09:33 AM UTC+10, musicloverlch wrote:
Well, I wish it was more elegant. This is kinda clunky. I'm still open to ideas.
If Month(Me.QuarterEnd) = 3 Then
intMonthStart = 1
intYearStart = Year(Me.QuarterEnd)
dteSearchStart = DateValue(intMonthStart & "/1/" & intYearStart)
intMonthEnd = 3
intYearEnd = Year(Me.QuarterEnd)
dteSearchEnd = DateValue(intMonthEnd & "/31/" & intYearEnd)
End If
--- Synchronet 3.21b-Linux NewsLink 1.2