First & last days of last month

from the Artful Common Queries page


select 
  date_format(curdate() - interval 1 month,'%y-%m-01') as firstday,
  last_day(curdate() - interval 1 month) as lastday;

Last updated 4 Apr 2024