Page 1 of 1

[Solved] Query Month & Date from multiple years

Posted: Sun Jan 08, 2023 1:39 am
by Dalke55
I need to query Date Time stamp field for specific Day of a Month from multiple years in the same data set. Example January 11 from 2019, 2020, 2021, 2022. Thank you in advance.

Re: Query Month & Date from multiple years

Posted: Sun Jan 08, 2023 6:21 am
by FJCC
If you are using the default HSQLDB database engine, it has DAYOFMONTH() and MONTH() functions, so you could include

Code: Select all

WHERE DAYOFMONTH("DATE_COLUMN_NAME") = 11 AND MONTH("DATE_COLUMN_NAME") = 1
in you query

Re: Query Month & Date from multiple years

Posted: Mon Jan 09, 2023 4:08 am
by Dalke55
Thanks for the assistance!