MySQL Forums
Forum List  »  Newbie

Re: Date Manipulation
Posted by: Peter Brawley
Date: May 05, 2020 12:38PM

You'd need to extract year and month portions, then write logic to handle end-of-year issues, but that'd be a waste of time. Simpler to form a date, eg yyyy-mm-01, and take the left 7 chars of the result of thatdate - interval 1 month, directly or with date_sub().

Options: ReplyQuote


Subject
Written By
Posted
May 05, 2020 12:11PM
Re: Date Manipulation
May 05, 2020 12:38PM
May 06, 2020 08:39AM
May 07, 2020 07:49AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.