Adding records with null dates

  • Thread starter Thread starter DellaCroce
  • Start date Start date
D

DellaCroce

This may seem very simple to you all, but if I am using a SQL statement to
add a new record to a table with dates in it, and the date needs to be
null/blank during the add, what do I put in the Insert statement? If I just
use '' for a blank it gives me an error that the types do not match. Seem
like a simple thing, but it is a puzzle to me today.

Thanks
 
Either leave the dates out of the SQL statement, or else specify Null as the
value.
 
Hi Greg

Use the word Null.

Or you can just leave the field out of your SQL altogether and the field
will get the default value, which is presumably Null.
 
While NULL does did not work in the SQL statement that I was building, I did
get it to work by specifying the field names (leaving out the ones for date
that were blank) and then leaving out the fields.

Thanks all for the help!

Graham Mandeno said:
Hi Greg

Use the word Null.

Or you can just leave the field out of your SQL altogether and the field
will get the default value, which is presumably Null.
 
Back
Top