Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Precision problem???
Message
From
14/03/2014 17:23:33
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01596565
Message ID:
01596580
Views:
49
This message has been marked as a message which has helped to the initial question of the thread.
>My colleague (tester) told me she reproduced the same problem locally with 30 minute lessons. The incentive of less than .5 is still firing for them.
>
>This doesn't make much sense since the SET DECIMALS is not changed in the application and it's default VFP value.
>
>I am going to try to play with it later myself in debugging mode.

It may be that the fractional seconds portion of the VFP datetime values is not exactly .000, even though it (nominally) is in SQL Server. In that case, as you've already found you can ROUND( ) to a reasonable number of decimals, or use a fixed tolerance e.g.
* Tolerance of 0.5 seconds
IF End_Time - Start_Time > 1799.5

* Another tip - if you're working with values you suspect are not precise, performing mathematical operations
* on them makes the problem worse. Use the values directly (like the line above) rather than something like
IF ( End_Time - Start_Time ) / 3600 > 0.5
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Reply
Map
View

Click here to load this message in the networking platform