jgoodman00
Programmer
- Jan 23, 2001
- 1,510
I am executing some SQL to insert a record into my underlying DB.
I have a number of parameters, one of which is a date field. This may or may not be null. If it is null, I want null inserted, rather than the 01/01/1901 default.
I am therefore using the following, which I am sure worked a few days ago:
I tested this a few days ago & was sure it worked, however it is now inserted null no matter what is entered.
Am I going crazy?![[wink] [wink] [wink]](/data/assets/smilies/wink.gif)
Any suggestions?
Cheers,
James Goodman MCSE, MCDBA
I have a number of parameters, one of which is a date field. This may or may not be null. If it is null, I want null inserted, rather than the 01/01/1901 default.
I am therefore using the following, which I am sure worked a few days ago:
Code:
cmdSQL.Parameters.Add("@DateRequired",strDateRequired).Value = System.DBNull.Value
I tested this a few days ago & was sure it worked, however it is now inserted null no matter what is entered.
Am I going crazy?
![[wink] [wink] [wink]](/data/assets/smilies/wink.gif)
Any suggestions?
Cheers,
James Goodman MCSE, MCDBA