Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with TTOS in app but not always
Message
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00838539
Message ID:
00838548
Views:
28
This message has been marked as the solution to the initial question of the thread.
Kirk,

See PRB: DateTime Subtraction May Not Produce an Exact Integer mskb #258998. Changing
lnTotalSecs=INT(ttEnd-ttStart)
* to
lnTotalSecs = INT(ROUND(ttEnd-ttStart,0))
should fix the problem.


>My application calculates the number of seconds between two time periods. Based of this calculations it determines how many charges to insert. A customer told me that "sometimes" it drops a charge. I pulled their data back and looked at one of the cases in question, and sure enough, when I run it, it's dropping one second which throws off the charge. I've got the debugger open as it runs the code, and I see the "right" date/time values. In this case:
>
>
>ttStart=10/03/2003 09:20:00   && DateTime memvar
>ttEnd  =10/03/2003 10:00:00   && DateTime memvar
>lnSeconds = ttend-ttstart     && Ruturns 2399 in program instead of 2400
>
>
>I put these values in a command window, and subtract the datetime fields I get 2400. This same case, I can put other time values in and it works perfect. Not sure where to start looking to figure out what I'm doing wrong. Set('seconds')=ON and hours are set to 24. I've watched it all the way until this function is called, and it shows 2400, as soon as it gets here, ttstart-ttend=2399
>
>Here is my code:
>
<snip>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform