>Hi all,
>
>Can anyone explain how to calculate the difference between two dates where the result is number of days difference?
>
>Example:
>Date1 - Date2 = xDays where Date1 is always older than Date2
>10/10/02 - 12/12/02 = ?days
>
>Thanks,
>
>Scott
? dDate2 - dDate1
? date() - {^2003/1/1} && Days past since year start 2003
? date() - 1 && Yesterday as date
? date() + 1 && Tomorrow as date
In VFP subtraction is overloaded to work on dates too.
If you subtract 2 date values you get difference in days (if lte 0 than then first date is older).
If you subtract/add a numeric from a date you get n days before/after date.
It operates on datetime too but then difference is in seconds not days.
Cetin