Oracle database
SELECT NVL( CURRENT_DATE + (col1 * 1.5), col2)
FROM t1;
* col1 and col2 are assumed to be INTERVAL YEAR TO MONTH types
Symfoware Server
SELECT NVL( CURRENT_DATE + CAST(col1 * 1.5 AS INTERVAL YEAR TO MONTH), col2) FROM t1;
* col1 and col2 are assumed to be INTERVAL YEAR TO MONTH types
INTERVAL YEAR TO MONTH type multiplication and division result in INTERVAL YEAR TO MONTH type and any fraction (number of days) will be truncated.
INTERVAL YEAR TO MONTH type multiplication and division result in INTERVAL type and fractions (number of days) will not be truncated.
Convert using the following procedure:
Search locations where the keywords "*" or "/" are used in multiplication or division, and check if the specified value is INTERVAL YEAR TO MONTH type.
If the value is INTERVAL YEAR TO MONTH type, use CAST to explicitly convert the operation result to INTERVAL YEAR TO MONTH type.