That's a good question Aaron, I hadn't thought to use the build in functions
from SQL to do that for me, I like the idea.

Rob

-----Original Message-----
From: Aaron Rouse [mailto:[EMAIL PROTECTED] 
Sent: 16 October 2007 12:55
To: CF-Talk
Subject: Re: CreateODBCDateTime

Out of curiosity if the date/time you want to put in is the system date/time
then why even pass it in via CF over using the databases built in functions
for date/time?

On 10/16/07, Robert Rawlins - Think Blue <
[EMAIL PROTECTED]> wrote:
>
> Hello Guys,
>
> I've never been in the habit of using CreateODBCDateTime() in the past but
> after reading a few times that it's the recommended route to go when
> entering values into the database I thought I'd give it a shot, however
> its
> causing a few issues and so thought I'd come and clear up how this is best
> applied.
>
> I'm running SQL Server 2k5 and on my create and update methods I write the
> current date and time to a couple of columns, using the following method:
>
>
>
> 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.
>
>
>
> 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? And perhaps
> elaborate a little on when and where I should be using the
> createODBCDateTime() method and where I should not?
>
>
>
> Thanks for your time guys, this seems like a bit of a silly question to
> ask
> but thought I'd get your thoughts on it.
>
>
>
> Rob
>
>
>
>
>
> 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Download the latest ColdFusion 8 utilities including Report Builder,
plug-ins for Eclipse and Dreamweaver updates.
http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta

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

Reply via email to