Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
A Datetime problem
Message
From
23/12/1999 01:24:57
 
 
To
18/12/1999 22:36:17
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00305771
Message ID:
00307778
Views:
19
The difference isn't between storing the value and printing it. This has to do with precision of the integer data type. An Integer is only 4 bytes in size. Try a Numeric or a Float (both 8 bytes) and you'll get 36000.

CREATE CURSOR test (START_DT T, END_DT T, CALC_SEC N)
ltStart = {^1999-12-05 08:00}
ltEnd = {^1999-12-05 18:00}
INSERT INTO test (START_DT, END_DT, CALC_SEC) VALUES ;
(ltStart, ltEnd, ltEnd -ltStart)
? ltEnd - ltStart
? CALC_SEC

Dave

>I have a problem with a datetime calculation. I am running VFP6.0 (No SP3 yet) I run the following:
>
>create cursor test (START_DT T, END_DT T, CALC_SEC I)
>ltStart = {^1999-12-05 08:00}
>ltEnd = {^1999-12-05 18:00}
>insert into test (START_DT, END_DT, CALC_SEC) VALUES ;
> (ltStart, ltEnd, ltEnd -ltStart)
>? ltEnd - ltStart
>? CALC_SEC
>
>I get a responce of:
>
>36000
>35999
>
>Whats the difference between storing the value in a field or just printing it? Ok, 1 seconds not that big of a deal but I spent a few hours trying to figure out why my calculations were off. Do other versions of VFP have this same problem?
>
>-David-
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform