first and last day of the month

Here is a quick way to find the first and last day of the month :

with temp1 (first_day_of_month,last_day_of_month)
as
(values ((current date – day(current date + 1 month) days) + 1 DAY,
 (current date + 1 month) – day(current date +1 month) days)
)
select * from temp1;

About rpillai

I am a technology enthusiasts and love to work with databases and other technology. Learning new things everyday and don't think the path ever ends ...
This entry was posted in db2 and tagged , , , , . Bookmark the permalink.

Comments are closed.