subtracting two user defined dates

jie711

New Member
Good day!
Im just want to know the code of getting the result of two
different dates.
I've been working on 3 fill-ins & 1 command buttons but
I still can't figure out the code for it....

Many thanks to all of you...
 

jongpau

Member
Hi,

I am not sure if this is what you want to do, but I'll give it a go anyway:
Code:
  DEF VAR lvDate1      AS DATE NO-UNDO.
  DEF VAR lvDate2      AS DATE NO-UNDO.
  DEF VAR lvDifference AS INT  NO-UNDO.

  ASSIGN lvDate1      = TODAY
         lvDate2      = DATE(10,13,1999)
         lvDifference = lvDate1 - lvDate2.
  MESSAGE lvDate2 "is":L lvDifference "days before":L lvDate1 ".":U
          VIEW-AS ALERT-BOX INFORMATION.
The above shows the difference (in days) between 2 dates.
If this is not what you want, you may have to give a more detailed explanation of what it is you are trying to do (maybe with a code sample of what you have done sofar).

HTH.
 
Top