Get rid of the "NULL" on your insert and replace with NULL

ie 

<cfif est_start_date IS NOT "">
        <cfset str_est_start_date = #est_start_date#">
<cfelse>
    <cfset str_est_start_date = NULL>
</cfif>
---------------------------------------
Date: Wed, 25 Oct 2000 14:33:01 -0400
From: James Taavon <[EMAIL PROTECTED]>
To: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
Subject: Need Help Badly...Datetime Overflow Error
Message-ID: <[EMAIL PROTECTED]>

This is a multi-part message in MIME format.
--------------D466D3B5107DDC4674AB907F
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Ok,

I can't seem to get this problem figured out. Code is below. I
previously had a CF application with DB2/NT running on the back-end.
Everything worked just fine. I now transferred/recreated the database on
an AS/400 system. Using DB2 Connect to communicate between CF (running
on Solaris) and the AS/400 machine. 

I am getting a Datetime overflow error when assigning NULL values for
date fields. This worked fine on DB2/NT, but the AS/400 does not like
it. I have also made sure that my fields are setup to accept null
values. Does anyone have any experience with this?

I am passing these values though to the action file for insertion in to
the database, note the "" indicating NULL value.
<input type="hidden" name="est_start_date" value="">
<input type="hidden" name="est_comp_date" value="">
<input type="hidden" name="act_start_date" value="">
<input type="hidden" name="act_comp_date" value="">

I then evaluate the values of each field in the action file before the
SQL INSERT.

<cfif #est_start_date# IS NOT "">
        <cfset str_est_start_date = "#est_start_date#">
<cfelse>
    <cfset str_est_start_date = "NULL">
</cfif>

<cfif #est_comp_date# IS NOT "">
        <cfset str_est_comp_date = "#est_comp_date#">
<cfelse>
    <cfset str_est_comp_date = "NULL">
</cfif>

<cfif #act_start_date# IS NOT "">
        <cfset str_act_start_date = "#act_start_date#">
<cfelse>
    <cfset str_act_start_date = "NULL">
</cfif>

<cfif #act_comp_date# IS NOT "">
        <cfset str_act_comp_date = "#act_comp_date#">
<cfelse>
    <cfset str_act_comp_date = "NULL">
</cfif> 
------------------------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message 
with 'unsubscribe' in the body to [EMAIL PROTECTED]

Reply via email to