Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Null date return from MSSQL
Message
General information
Forum:
Visual Basic
Category:
Database DAO/RDO/ODBC/ADO
Miscellaneous
Thread ID:
00441181
Message ID:
00441262
Views:
12
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform