Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Date calculation problem
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00598520
Message ID:
00598521
Views:
20
>I am having problem with the following formula
>ROUND(((DATE()-(DATE()-Payroll_tbl.edate))-Employee.e_cntysnrdte)/365.25,1)
>
>
>where my Payroll_tbl.edate = 11/30/01 and my Employee.e_cntysnrdte = 03/11/00
>I get the result of 101.7 instead of 1.7
>
>
>

Hi Nick,

First, you can simplify your expression
ROUND((Payroll_tbl.edate-Employee.e_cntysnrdte)/365.25,1)
Second, you got bitten by Y2K bug. My guess is that
Payroll_tbl.edate = 11/30/01 = 11/30/2001
but
Employee.e_cntysnrdte = 03/11/00 = 03/11/1900

Use SET CENTURY ON to avoid Y2K problems and see what dates actualy are.
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform