Hi, Guys..
I'm trying to insert null value into datetime column in SQL, this scenario when no date was entered, so let the column's date inserted by null value. Basically there is no error when inserting process, but SQL will convert it to "1900-01-01 00:00:00.000" instead what i need just "NULL".
any help will be greatly appreciated..
Thanks..
I'm trying to insert null value into datetime column in SQL, this scenario when no date was entered, so let the column's date inserted by null value. Basically there is no error when inserting process, but SQL will convert it to "1900-01-01 00:00:00.000" instead what i need just "NULL".
VB.NET:
sqlstring = "INSERT INTO TBL_TRANSACTION (TransNo, TransDate, ItemCode, Qty, DateReq) " & _
"VALUES ('" & txtTransNo.Text & "', " _
& "'" & txtTransDate.Text & "'," _
& "'" & txtItemCode.Text & "'," _
& "" & txtQTY.Text & "," _
& "'" & IIf(IsDBNull(txtDateReq.Text) = True, DBNull.Value, txtDateReq.Text & "')"
any help will be greatly appreciated..
Thanks..