Hi,
I would like to have a routine that will return a monthenddate for a given date.date is in yyyy-mm-dd format.
Thanx .
Routine to get month-enddate
Moderators: chulett, rschirm, roy
Here's the trick. Write a function to take a date YYYY-MM-DD, add one to the month and allow for going over 12, then use the ICONV function to make the date the internal integer value. Subtract one from that value and then use OCONV to reformat the date. You will now have the last day of the month for your given date and because you used ICONV and OCONV those functions have accommodated leap years and days-in-a-month discrepancies.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Re: Routine to get month-enddate
You could use MONTH.LAST with MONTH.TAG (in yyyy-mm format) as input. Use the conv brothers to get the output in desired format. FYI, it is available in DSTransforms\Built-in\Dates.sdfasih wrote:Hi,
I would like to have a routine that will return a monthenddate for a given date.date is in yyyy-mm-dd format.
Thanx .
gateleys