Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Exact same dates not equal ???
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00844225
Message ID:
00844472
Vues:
31
It depends on the value added to the date.

date1={^2004-5-21}
date2={^2004-5-21}
?date1 = date2 && = .T.

date2={^2004-5-21} + 0.00001
?date1 = date2 && = .T.

date2={^2004-5-21} + 0.0001
?date1 = date2 && = .T.

date2={^2004-5-21} + 0.001
?date1 = date2 && = .F.

date2={^2004-5-21} + 0.01
?date1 = date2 && = .F.


>Yes, it always confused. Difference of two dates gives the integer, but date itself seems not.
>
>ld1=date()
>ld2=ld1+0.5
>?ld1=ld2 &&returns .F.
>?ld1-ld2 =0 &&returns .T.
>
>
>
>
>>Also interesting is that this code works
>>
>>*-- returns .T.
>>c_ScanCursor.dDateField - dDate2Match = 0
>>
>>c_ScanCursor is readwrite cursor created from an sql query
>>
>>
>>there is code to insert a record if the reccount("c_ScanCursor") = 0
>>like this
>>
>>
>>if reccount("c_ScanCursor") = 0
>>m.dDateField = dDate2Match
>>* other memvars
>>* other memvars
>>
>>insert into c_ScanCursor from memvar
>>endif
>>
>>
>>then the comparison takes place inside a scan loop
>>
>>
>>
>>
>>>Hi All,
>>>
>>>I am comparing 2 dates and getting unexpected results:
>>>
>>>Here is what is displayed in the Debugger watch window:
>>>
>>>
>>>
>>>c_ScanCursor.dDateField {5/21/2004}
>>>dDate2Match {5/21/2004}
>>>c_ScanCursor.dDateField = dDate2Match .F.
>>>vartype(c_ScanCursor.dDateField) "D"
>>>vartype(dDate2Match) "D"
>>>SET("Strictdate") 0
>>>
>>>
>>>
>>>What Gives ???
>>>
>>>TIA
>>>
>>>Greg
Dennis Lindeman
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform