Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Selecting all data from a table where it is the first of the month

I am using Data Studio to query a large table in a relational database. I am attempting to get all of the data where a certain column with the data type of DATE is the first of the month. The dates in the columns range from about 1990 to 2023 and are in the YYYY-MM-DD format.

I am not very proficient with SQL and all answers I’ve found for anything similar don’t seem to make any sense to me.

Any help would be appreciated.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

SELECT * FROM data_table
WHERE date_column ... is the first of the month;

>Solution :

I’m assuming DB2 because you’ve tagged IBM Data Studio:

Can you use DAYOFMONTH() like this?:

SELECT * FROM data_table
WHERE DAYOFMONTH(date_column) = 1;
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading