As a first step, I would remove the single quotes from around your date
values in the query statement.
Also, output your query string to the screen so you can see what is actually
being submitted to the db.
-----Original Message-----
From: James Taavon [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 25, 2000 1:33 PM
To: CF-Talk
Subject: Need Help Badly...Datetime Overflow Error
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>
The INSERT query
<cfquery name="Assign" datasource="OIMDBADM">
insert into oimdbadm.assigned (id, date, time, agency, reqtype,
assigned, address, requester, req_email, phone, account_code,
est_start_date, est_comp_date, est_man_hrs, act_start_date,
act_comp_date, act_man_hrs, due_date, title, descrip, comments,
completed)
values ('#id#', '#date#', '#time#', '#agency#', '#reqtype#',
'#form.assigned#', '#form.address#', '#requester#', '#req_email#',
'#phone#', '#form.account_code#', '#str_est_start_date#',
'#str_est_comp_date#', '#est_man_hrs#', '#str_act_start_date#',
'#str_act_comp_date#', '#act_man_hrs#', '#due_date#', '#title#',
'#descrip#', '#form.comments#', '#form.completed#')
</cfquery>
--------------D466D3B5107DDC4674AB907F
Content-Type: text/x-vcard; charset=us-ascii;
name="jtaavon.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for James Taavon
Content-Disposition: attachment;
filename="jtaavon.vcf"
begin:vcard
n:Taavon;James
tel;cell:(443) 506-2117
tel;fax:(410) 333-5203
tel;work:(410) 767-3415
x-mozilla-html:FALSE
org:Department of Labor, Licensing and Regulation;Office of Information and
Technology
version:2.1
email;internet:[EMAIL PROTECTED]
title:Senior Web Developer
adr;quoted-printable:;;1100 N. Eutaw Street,=0D=0ARoom
203;Baltimore;MD;21201;
fn:James Taavon
end:vcard
--------------D466D3B5107DDC4674AB907F--
----------------------------------------------------------------------------
--------------------
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]
------------------------------------------------------------------------------------------------
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]