On 10/16/07, Robert Rawlins - Think Blue
<[EMAIL PROTECTED]> >
> DateCreated = <cfqueryparam value="#now()#" cfsqltype="cf_sql_timestamp" />
>
> This has always worked nicely and I've never really had any reason to
> believe that it wouldn't, however, like I say, after reading about the
> createODBCDateTime() method I thought I'd give that a shot if it's
> considered to be a better practice.

It's not.  There is NO reason to use createODBCDateTime when you're
using cfqueryparam.  None that I'm aware of.

The function exists so that you can do this:

DateCreated = #createODBCDateTime(Now())#

Without having to worry about the date format that the database wants.

However, when using cfqueryparam, that's all taken care of through
bind variables.

> DateCreated = <cfqueryparam value="#createODBCDateTime(now())#"
> cfsqltype="cf_sql_timestamp" />
>
> However this only enters the date into the database, and the time portion is
> left to sit as 00:00:00. Can anyone explain why this is?

It's possible that when passing the value generated by
createODBCDateTime() into the query as a bind variable, that the
database simply doesn't understand the time portion of the value.

Solution:  don't do it that way :)

-- 
Rick Root
Check out CFMBB, BlogCFM, ImageCFC, ImapCFC, CFFM, and more at
www.opensourcecf.com

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade to ColdFusion 8 and integrate with Adobe Flex
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:291187
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