MySQL Forums
Forum List  »  MySQL Workbench

Add different frequency days to dates
Posted by: Arrie Schoeman
Date: May 09, 2022 06:13PM

Hi I can't find a solution To this.
Table - assetno, asset_type, cur_date, frequency, base_date columns.

I want a new column in the table to calculate the new_date by adding the frequency to the base_date. The base_date will be a previous date. the frequency will be days.
base_date 2021-05-20 + frequency 365 days.. = 2022-05-20 in the new_date column

The frequency will be different for most of the assets depend on the asset type. Some assets can be 30, 60, 120, 180 200 365 days or anything between. So I can't just use DATE_ADD with INTERVAL of ?? days. It will add only the days in the interval and not the frequency days.

I am using MySQL with MySQL Workbench.

Options: ReplyQuote

Written By
Add different frequency days to dates
May 09, 2022 06:13PM

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.