Larry asked:
> I'm trying to take a date that is entered as a string value then convert
> it to a date and subtract that date from another date that was created
> using datebuild. When I attempt to subtract one from the other I keep
> getting an error. I've searched the archives and can't find anything on
> this.
> Can someone set me straight.
>
> Here's what I've tried (inside of MPEX):
>
> %SETVAR D1 DATEBUILD(70,01,01)
> %SETVAR D2 DATEBUILD(06,12,28)
> %CALC !D2-!D1
>
> Processing 06/12/28-70/01/01
> ^
> Error: Expected date in MM/DD/YY format, not 70/01/01
Date processing remains somewhat of a mystery to me (and I used to
work at Vesoft). The best solution I can find is to combine both
DATEBUILD calls in a single expression, and avoid dereferencing
the Date variables:
%calc datebuild(70,01,01) - datebuild(06,12,28)
-13510, $FFFFCB3A, %37777745472, #65535/#52026, "...:"
Hope this helps,
Paul Taffel
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|