Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Date calculation problem
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00598520
Message ID:
00598521
Vues:
19
>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--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform