Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
2.0000 = 1 Huh???
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01484194
Message ID:
01484237
Vues:
29
>>Hi Gang...
>>
>>Something weird here....
>>
>>I was adding some new code to an old part of the POS program here.....
>>
>>Here is the new code...
>>
>>
>>ldtBegin = DATETIME(YEAR(mH_BDate),MONTH(mH_BDate),DAY(mH_BDate),mBeg_Hr,mBeg_Min,0)
>>ldtEnd   = DATETIME(YEAR(mH_EDate),MONTH(mH_EDate),DAY(mH_EDate),mEnd_Hr,mEnd_Min,0)
>>
>>lnElapsedSeconds = ldtEnd - ldtBegin
>>
>>*Convert to minutes
>>lnElapsedMinutes = INT(lnElapsedSeconds / 60)
>>
>>
>>And as I traced it, here are the results....
>>
>>lnElapsedSeconds = 120
>>
>>ok
>>
>>lnElapsedMinutes / 60 = 2.0000
>>
>>finally....
>>
>>INT(lnElapsedMinutes ) = 1
>>
>>OK... I was expecting 2 .... so.... where did I go wrong?
>>
>>Thanks!
>
>Because of the non-precise nature of the dates, the lnElapsedSeconds may not be 120 exactly. You may want to round that value first, say, round(lnSeconds,0) / 60
>
>or int(Round(m.lnElapsedMinutes,0))

Thanks a bunch!
Tommy Tillman A+ NetWork+ MCP
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform