Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DateTime comparison
Message
De
19/03/2002 11:25:07
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00633381
Message ID:
00634502
Vues:
25
>Hi!
>
>I have a problem that has appeared after I mass modified a column in a table containing datetime values. The table stores shift related information for a production facility. One of the columns (shiftstart) is the start time of each shift. Somehow two records were missing leaving a 16 hr gap between one shift and the next is how this started. I opened the table, browsed it and used the Table/Replace Field function from the menu bar to replace all the datetime values from the point of the missing records forward with their value minus 57,600 seconds (16 hrs). This corrected the missing datetime values (shiftstart), but now when this value is compared with a datetime equal to it (example:shiftstart = {03/15/2002 08:00:00 AM}), the comparison fails. This is the worst part: the comparison only seems to fail for the 2nd shift (EX: 03/14/2002 04:00:00 PM )and 3rd shift (EX:03/15/2002 12:00:00 AM). First shift (EX:03/15/08:00:00 AM) doesn't have this problem so far. Anyone have any
>suggestions as to why this is happening? The next step we have is to delete all of the modified records and replace them.

Most of the problems with comparing datetimes comes from the fact they're stored with milliseconds included, but these milliseconds are never displayed. It was also observed here that there are some roundoff errors when seconds are added to a datetime field, which may mean that your 04:00:00 PM is actually stored as 04:00:00.001 or something like that. Backup first and try to
replace all shiftstart with ctot(ttoc(shiftstart))
That should round them up and get rid of milliseconds.

HTH

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform