'How do I find the first and last day of the previous month using SQL?

I am using IBM Data Studio to access data on an AS400, I cannot figure out how to programmatically find the first and last date of the previous month to use in an BETWEEN clause. For example, if I ran it today it would return 20211201 and 20211231. I have done some other date math in the past but this one is beyond me. Below is an example of a date function I have used successfully in this version of SQL.

{DEC(DATE(DAYS((CURRENT_DATE) - 15 DAY)))}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source