Question & Answer
Question
I have a query which begins with a date on a row and adds a month up to a variably occurring number, for example, 1991-11-05 and the query adds a month to this date until it reaches a certain number of occurrences. The result I end up with is 1991-11-05, 1991-12-05, 1992-01-05, 1992-02-05, etc. What I would like is just the year and month of this date in a month/year format. In general, my query for this date is as follows: (START_DTE -1 MONTH) + FACTOR_MONTHS where FACTOR MONTHS are from 1 to nnn. I tried using SUBSTR, but I continually get a SQL error of: Argument '1' of scalar function 'SUBSTR' is invalid. This error occurs because I tried to use SUBSTR as follows: SUBSTR(((START_DTE -1 MONTH) + FACTOR_MONTHS),1,7)
Log InLog in to view more of this document
Was this topic helpful?
Document Information
Modified date:
01 May 2025
UID
swg21006696