Update SQL Blank Date Field?

  • Thread starter Matt's Challenge.com
  • Start date
M

Matt's Challenge.com

I have a end of use date field, and I am running into data type mismatch and
syntax errors. What is the way the way to allow a date field to be blank in
this update SQL?

UPDATE Equipment_In_Use SET Equipment_Purchase_Date =
'::Equipment_Purchase_Date::' , Equipment_Start_Date =
'::Equipment_Start_Date::' , Equipment_End_Date = '::Equipment_End_Date::' ,
Equipment_Insurance_Coverage = ::Equipment_Insurance_Coverage:: ,
Equipment_Charitably_Funded = ::Equipment_Charitably_Funded:: ,
Equipment_Donated = ::Equipment_Donated:: , Equipment_Cost =
'::Equipment_Cost::' , Equipment_Date_Submitted =
'::Equipment_Date_Submitted::' WHERE (ID_Equipment = ::ID_Equipment::)
 
K

Kevin Spencer

The Date value you pass in can't be blank (blank is not a date). If you pass
in a date value, it must be a date. If you don't want to pass it in, you
have 2 choices:

1. Leave the date column out of the query.
2. Configure the database to allow null values, and pass Null into the
query, like so:

Equipment_Date_Submitted = Null

NO punctuation around "Null"

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top