Click to See Complete Forum and Search --> : Urgent :Store null date into table


Blue Sky
April 9th, 2001, 06:40 AM
I have a field called dte which is a datetime type and allows null.
But I can't insert a null date into it. I found out that dte only stores "1/1/1900", but not null

.........
.........

drp = " " (I also tried drp = null, but it can't work)

sql = "Insert Into Cus_TBL Values " & _
"('" & Trim(txtID.Text) & "','" & _
Yr & "','" & drp & "')"

Please help me !
It's urgent !!!

Iouri
April 9th, 2001, 06:54 AM
Try drp without apostrophies around it

...Yr, drp & ")"

Iouri Boutchkine
iouri@hotsheet.com

Blue Sky
April 9th, 2001, 09:34 AM
It can't work !!!

thomas_dipu
April 9th, 2001, 10:05 AM
try this

sql = "Insert Into Cus_TBL Values ('" & Trim(txtID.Text) & "','" & Yr & "',"

if drp = "" then
sql = sql + "NULL"
else
sql = sql + '" & drp & "')"
end if
msgbox sql