Question on date time INSERT

  • Thread starter Thread starter Teo
  • Start date Start date
T

Teo

Hi!
I am trying to insert a value through a query to the DB. One of the fields
I'm inserting is a date/time.
That value is optional.
The problem I'm having is that when I run my query if the value is " " then
it is reported by my front end application as NULL and the DB sends me an
error for data type since I have the NULL value between single quotes (').
If I assign it a value, such as 12-Jul-72 it works perfectly.
What can I do to avoid this error?
I'm using it along with ColdFusion from Macromedia.

Teo
 
What you want is either to insert Null without the quotes, or simply to omit
the Date field from the Insert (i.e.: don't list it in the list of fields
being updated, and don't provide a value for it)

Unfortunately, I've never used ColdFusion, so I don't know how you'd do it
there.
 
Back
Top