Hey everyone, this is my first post here so go easy on me haha.
Basically in my program I'm taking the current date, then with that current date I want to use the first of that month. Then I want to get the difference in months between the date I built and another date.
Here's my d-Spec:
Date, Time or Timestamp value is not valid.
Any help you guys could give would be awesome. Been working on this for a few days, and I've only been programming for a year or so. I need some of your amazing wisdom!!!
Basically in my program I'm taking the current date, then with that current date I want to use the first of that month. Then I want to get the difference in months between the date I built and another date.
Here's my d-Spec:
Code:
D TDATE_ S 10D DATFMT(*ISO)INZ(*SYS) D TDiffMonths_ S 4S 0 D CompDate_ S 10d D TDateDay_ S 2A D TDateYear_ S 4A D TDateMonth_ S 2A D HoldField_ S 10A D paydate_ d datfmt(*eur) and here's my code: /free TDateYear_ = %Subst(%Char(TDATE_):1:4); TDateMonth_ = %Subst(%Char(TDATE_):6:2); TDateDay_ = '01'; HoldField_ = TDateDay_ + '/' + TDateMonth_ + '/' + TDateYear_; CompDate_ = %DATE(HoldField_:*ISO); [B]//my error happens here [/B] DiffMonths_ = %Diff( paydate_: CompDate_: *MONTHS ); //paydate_ gets populated before all this code. /end-free
Any help you guys could give would be awesome. Been working on this for a few days, and I've only been programming for a year or so. I need some of your amazing wisdom!!!
Comment