Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Returning Date values that are NULL
Message
From
03/05/2006 21:28:18
 
 
To
03/05/2006 16:08:24
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
01118409
Message ID:
01118996
Views:
17
>Without actually trying it myself, I don't know for sure. I suggest you experiment with it.

With the SQLClient provider, this can be used to detect a null value. Null is supported, as already mentioned. However, I was not able to put an empty date value. So, I guess this would do:
        ' Return True if a date is empty
        ' expO1 Date
        '       This parameter is defined as Object as if we define it as a Date, it won't work in SQLClient
        Public Function EmptyDate(ByVal tdDate As Object) As Boolean
            Dim llEmpty As Boolean
            Dim ldDate As Date
            llEmpty = False

            ' Different provides handle the empty and null dates differently
            Select Case oApp.nSQLMode

                ' OleDb
                Case 1
                    ldDate = New Date(1899, 12, 30)
                    If tdDate = ldDate Then
                        llEmpty = True
                    End If

                    ' SQLClient
                Case 2
                    If tdDate Is DBNull.Value Then
                        llEmpty = True
                    End If

                    ' ODBC
                Case 3

            End Select

            Return llEmpty
        End Function
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Reply
Map
View

Click here to load this message in the networking platform