How can I write a Insert into SQL statment that will accept null values and only will insert statement that is not null.
Here is my SQL for that statment... I am using ASP. I hope I am clear.. the SQL works but bombs out when it has null value.. I tried Where clause but could not get it to work because of syntax... you could help on that if possible.
Samir
Dim iLoop
For iLoop = 0 To iCount
strProductID = Request(iLoop & ".ID")
strOnHand = Request(iLoop & ".OnHand")
strOnOrder = Request(iLoop & ".OnOrder")
strDate = Request(iLoop & ".Date")
SQL = "Insert into tblProductOrder (fldProductID, [fld#Ordered], [fld#OnHand], fldDateID) values (" _
& "'" & strProductID & "', " _
& "'" & strOnHand & "', " _
& "'" & strOnOrder & "', " _
& "'" & strDate & "' )"
'& " WHERE (((strOnOrder)>0) AND ((strOnHand)>0))
"
objConn.Execute(SQL)
Response.Write(SQL)
Next
Here is my SQL for that statment... I am using ASP. I hope I am clear.. the SQL works but bombs out when it has null value.. I tried Where clause but could not get it to work because of syntax... you could help on that if possible.
Samir
Dim iLoop
For iLoop = 0 To iCount
strProductID = Request(iLoop & ".ID")
strOnHand = Request(iLoop & ".OnHand")
strOnOrder = Request(iLoop & ".OnOrder")
strDate = Request(iLoop & ".Date")
SQL = "Insert into tblProductOrder (fldProductID, [fld#Ordered], [fld#OnHand], fldDateID) values (" _
& "'" & strProductID & "', " _
& "'" & strOnHand & "', " _
& "'" & strOnOrder & "', " _
& "'" & strDate & "' )"
'& " WHERE (((strOnOrder)>0) AND ((strOnHand)>0))
objConn.Execute(SQL)
Response.Write(SQL)
Next