Peaking of odd date formatting...I ran across an issue where a couple of
decimals were getting recognized as dates instead of being left a decimals.
One value was 9.707 and the other was 10.650.  Pass it though a isdate()
function and it returns yes.  Is this a known bug?  That's on CF7 on RHE (I
think...i know it is linux...)

Eric

-----Original Message-----
From: Zaphod Beeblebrox [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 19, 2007 10:15 PM
To: CF-Talk
Subject: Re: Date Not Formatting Correctly

Steve,

You either need to quote your date field in the insert query just like
the events field, or you need to cfparam it such as

<cfif IsDefined("FORM.Events") AND #FORM.EventDate# NEQ "">
<cfqueryparam cfsqltype="varchar" value="#FORM.Events#"/>,
<cfqueryparam cfsqltype="timestamp" value="#FORM.EventDate#"/>
 <cfelse>

My preference is to use the queryparam methods as they avoid troubles
with people using apostrophes in event names and also guards against
sql injection.  Especially since you're inserting data straight from a
form.



On 4/19/07, Steve LaBadie <[EMAIL PROTECTED]> wrote:
> Date is not formatting properly.  I get "12/30/189905/11/2006"
>
> I enter a date of 04/18/2007 and it takes the previous date entered into
the database and displays it again with next entry and adds 12/30/1899.  The
datatype in database is set to Date/Time.
>
> <cfset CurrentPage=GetFileFromPath(GetTemplatePath())>
> <cfif IsDefined("FORM.MM_InsertRecord") AND FORM.MM_InsertRecord EQ
"frmAddEvents">
> <cfquery datasource="member_login">
> INSERT INTO Events (Events, EventDate)
> VALUES (
> <cfif IsDefined("FORM.Events") AND #FORM.EventDate# NEQ "">
> '#FORM.Events#', #FORM.EventDate#
> <cfelse>
> NULL, NULL
> </cfif>
> )
> </cfquery>
>
> <form action="<cfoutput>#CurrentPage#</cfoutput>" method="post"
name="frmEvents" id="frmAddEvents">
> <input type="text" name="eventDate" id="eventDate" size="15"
maxlength="10" class="formveld" />
> <textarea name="events" cols="70" rows="10" id="events"
class="formveld"></textarea>
> <input name="Reset" type="reset" id="Reset" value=" Reset "
class="formveld">
> <input name="Submit" type="submit" id="Submit" value=" Submit "
class="formveld">
> <input type="hidden" name="MM_InsertRecord" value="frmAddEvents">
> </form>
>
> 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion MX7 and Flex 2 
Build sales & marketing dashboard RIA’s for your business. Upgrade now
http://www.adobe.com/products/coldfusion/flex2?sdid=RVJT

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:275915
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to