Focal Point
[CLOSED] Adding/Subtracting Dates

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1377081295

October 22, 2010, 10:06 AM
<d3nis370>
[CLOSED] Adding/Subtracting Dates
I am trying to do two things. One is take a date and add 30 to it. This is what I have so far. Also the LAST_CONTACT_DT is in P9 format.


DEFINE FILE FDI001
NEXTFOLLOWDATE/YYMD=FDI001.FDI001.FDI001_LAST_CONTACT_DT + 30


When I display NEXTFOLLOWDATE it returns this


Last contact dt
20100820

Next follow date
20100850


It should show


Last contact dt
20100820
Next follow date
20100919




The next thing I am trying to do is see how many days open an account has been. This is what I have so far. Also DT_REPORTED is in P9 format.


DEFINE FILE FDI001
CurrentDate/P9=20100903;
BEGDTI/I8YYMD=CurrentDate;
ENDDTI/I8YYMD=FDI001.FDI001.FDI001_DT_REPORTED;
BEGDT/YYMD=ENDDTI;
ENDDT/YYMD=ENDDTI;
DIFFDAYS/I4=BEGDT - ENDDT;


Once I display DIFFDAYS all I get are 0.

This message has been edited. Last edited by: Kerry,
October 22, 2010, 11:04 AM
Dave
...read the manual...! Roll Eyes

What is WF suppossed to do with +30 ?
+30 days?
+30 hours?
+30 months?

use the help!
Ironicly... search for : DATEDIF

Do tell you didn't even try that...

Greets,Dave


_____________________
WF: 8.0.0.9 > going 8.2.0.5
October 22, 2010, 05:27 PM
Doug
http://forums.informationbuild...731069712#4731069712 c/o: Mickey




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
October 24, 2010, 04:39 PM
Waz
FYI

The reason why your second option did not work is that you set the Begin and End dated the same.

BEGDT/YYMD=ENDDTI;
ENDDT/YYMD=ENDDTI;


As for adding a value to a date, if its stored ina P9, then its a number, you need to convert to a Smart Date, as you did in your second option.

This is basic stuff.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!