Default Date as 12:00 AM

Default Date as 12:00 AM

Post by Auntie Spa » Sat, 08 Aug 1998 04:00:00



Check the date variable and see if it is zero.  

    Dim dat as Date

    if dat = 0 then
        Debug.Print "Zero"
        rsData!datField = Null
    else
        rsData!datField = dat
    end if

AS    

    In VB even if we do not set the value of a Date variable, it turns out to be 12:00 AM. And actually gets saved in the dateTime field of an Oracle table. What is the best solution to remedy this problem. We do not want to check for 12:00 AM before saving it, because user might have entered this as an actual value. We want to store null. One way of doing this to use string variables and check for null string. But I wonder if it can still be done using a Date variable?

    thanks in advance.

    S. Virk

 
 
 

Default Date as 12:00 AM

Post by SVir » Tue, 11 Aug 1998 04:00:00


By doing rsData!datField = Null, Oracle will store 12:00:00 AM in the database. That's what we want to avoid.


    Check the date variable and see if it is zero.  

        Dim dat as Date

        if dat = 0 then
            Debug.Print "Zero"
            rsData!datField = Null
        else
            rsData!datField = dat
        end if

    AS    

        In VB even if we do not set the value of a Date variable, it turns out to be 12:00 AM. And actually gets saved in the dateTime field of an Oracle table. What is the best solution to remedy this problem. We do not want to check for 12:00 AM before saving it, because user might have entered this as an actual value. We want to store null. One way of doing this to use string variables and check for null string. But I wonder if it can still be done using a Date variable?

        thanks in advance.

        S. Virk