
March 8th, 2012, 01:12 PM
|
|
Contributing User
|
|
Join Date: Apr 2004
Posts: 58
Time spent in forums: 12 h 42 m 10 sec
Reputation Power: 10
|
|
|
Sending NULL Date Value
This task is using classic ASP and MS SQL database. There is a "CompletedDate" field, which is a "Date" datatype that does allow Null values. The default value is Null for new entries.
On this "update details" form, the user may or may not enter a date. However, I can't seem to pass a NULL value into the field if the user leave the date blank.
Can somebody tell me where I am going wrong? Here is the insert code. I've stripped everything out except just the date insert. Upon execution, it inserts "1900/01/01" into the CompletedDate field.
Code:
dbCon.Execute("UPDATE Orders SET CompletedDate = Null WHERE ID="&Request.QueryString("id"))
Now, when I run this exact same query directly using SQL Server Manager, it works just fine and inserts a NULL value.
|