Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Null date return from MSSQL
Message
 
Information générale
Forum:
Visual Basic
Catégorie:
Bases de données DAO/RDO/ODBC/ADO
Divers
Thread ID:
00441181
Message ID:
00441262
Vues:
10
>When accessing MSSQL datetime field with null values, VFP returns .null. but VB returns "12:00:00 AM" (using ADO). I guess this is more ADO behavior than VB?
>
>Thus, if I want to display the returned value on my VB form, I have to check this and code like this:
>
>If RS.Fields("MyDateField") = "12:00:00 AM"
> txtShipDate.Value = ""
>Else
> txtShipDate.Value = RS.Fields("MyDateField").Value
>End If
>
>There has to be a better way, isn't there? What's a good technique working with null datetime value? Also, is using MaskedEdit control for displaying/getting date data a "good" technique? TIA.

Hi John,

In VBA you can use function DateValue which gives the date part of the datetime value. Check Date part of the datetime value.

HTH, Igor
Igor Gelin
Database Developer
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform