[Solved] Query Month & Date from multiple years

Creating tables and queries
Post Reply
Dalke55
Posts: 25
Joined: Sat Jan 19, 2019 11:08 pm

[Solved] Query Month & Date from multiple years

Post 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.
Last edited by Dalke55 on Mon Jan 09, 2023 4:09 am, edited 1 time in total.
Apache OpenOffice 4.1.6 Windows 10
FJCC
Moderator
Posts: 9284
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Query Month & Date from multiple years

Post 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
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
Dalke55
Posts: 25
Joined: Sat Jan 19, 2019 11:08 pm

Re: Query Month & Date from multiple years

Post by Dalke55 »

Thanks for the assistance!
Apache OpenOffice 4.1.6 Windows 10
Post Reply