So I need to take an ISO date and transform it to YYYYMMDD numeric because that is how it is stored in the DB.
So I thought I was clever and wrote this...
However, when the ISO date of 2009-02-01 is entered, this produces tmpfdate = 00200921
if the date is 2009-02-01 then the tmpfdate is 02009228.
Is there an easier way to do this? Shouldn't this method work?
Is the %dec inside of the %char screwing it up and not giving me the leading 0?
So I thought I was clever and wrote this...
Code:
tmpfdate = %dec(%char(%dec(%subdt(fdate:*years):4:0)) + %char(%dec(%subdt(fdate:*months):2:0)) + %char(%dec(%subdt(fdate:*days):2:0)):8:0);
if the date is 2009-02-01 then the tmpfdate is 02009228.
Is there an easier way to do this? Shouldn't this method work?
Is the %dec inside of the %char screwing it up and not giving me the leading 0?
Comment