It should look something like:
INSERT INTO table (datecolumn,...)
VALUES (
<cfqueryparam cfsqltype="cf_sql_timestamp" value="#myvar#"
null="#YesNoFormat(NOT Len(myvar))#">,
...
)
Where myvar holds the date/time value and you want to insert null if it
is empty.
If you want to insert null if mycondition is false :
VALUES (
<cfqueryparam cfsqltype="cf_sql_timestamp" value="#myvar#"
null="#YesNoFormat(NOT mycondition)#">,
...
)
Just make sure that myvar always exists (it will be ignored if
mycondition is false.
Pascal
> -----Original Message-----
> From: cf coder [mailto:[EMAIL PROTECTED]
> Sent: 24 September 2004 15:14
> To: CF-Talk
> Subject: Re: datetime problems - 01/01/1900
>
> The table column allows null values.
>
> Hey Pascal, hope you're doing well mate! I copied your code. I am
checking
> for some condition; if it is false, I want to insert <null> in the
> datetime column.
>
> ActionDateTime = <cfqueryparam cfsqltype="cf_sql_timestamp" value=""
> null="#YesNoFormat(0)#">
>
> I get an error when I submit the form
>
> Error Occurred While Processing Request
> The cause of this output exception was that:
> java.lang.NullPointerException.
>
> Any ideas?
>
>
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
[Donations and Support]
- datetime problems - 01/01/1900 cf coder
- RE: datetime problems - 01/01/1900 Steve Brownlee
- RE: datetime problems - 01/01/1900 Pascal Peters
- Re: datetime problems - 01/01/1900 cf coder
- Re: datetime problems - 01/01/1900 cf coder
- RE: datetime problems - 01/01/1900 Pascal Peters
- RE: datetime problems - 01/01/1900 Tim Blair
- RE: datetime problems - 01/01/1900 Pascal Peters
- RE: datetime problems - 01/01/1900 Tim Blair
- Re: datetime problems - 01/01/1900 cf coder
- RE: datetime problems - 01/01/1900 Pascal Peters