How do I set a field of type "smalldatetime" in an SQL Server database to be null using VBA?
I've tried the following:
tempDate = GetDateField(301)
Debug.Print "DateUpd="; tempDate
rs!DateUpd = tempDate
GetDateField returns the 10 characters from an input string starting at column 301. If they are all blank then the function sets the return value to empty. When tempDate is empty it prints out as "00:00:00" and an Invalid Date/Time format message arises. If I set the type of the field in the database to "datetime" it all works fine.
I've tried the following:
tempDate = GetDateField(301)
Debug.Print "DateUpd="; tempDate
rs!DateUpd = tempDate
GetDateField returns the 10 characters from an input string starting at column 301. If they are all blank then the function sets the return value to empty. When tempDate is empty it prints out as "00:00:00" and an Invalid Date/Time format message arises. If I set the type of the field in the database to "datetime" it all works fine.