As noted, probably bettere using getUTCDate, there is no need for ColdFusion
to do the insertion.





 
"This e-mail is from Reed Exhibitions (Gateway House, 28 The Quadrant,
Richmond, Surrey, TW9 1DN, United Kingdom), a division of Reed Business,
Registered in England, Number 678540.  It contains information which is
confidential and may also be privileged.  It is for the exclusive use of the
intended recipient(s).  If you are not the intended recipient(s) please note
that any form of distribution, copying or use of this communication or the
information in it is strictly prohibited and may be unlawful.  If you have
received this communication in error please return it to the sender or call
our switchboard on +44 (0) 20 89107910.  The opinions expressed within this
communication are not necessarily those expressed by Reed Exhibitions." 
Visit our website at http://www.reedexpo.com

-----Original Message-----
From: Charlie Griefer
To: CF-Talk
Sent: Thu Jan 25 17:50:02 2007
Subject: Re: Insert Current Date/Time into SQL DB (CF101)

On 1/25/07, Tim Claremont <[EMAIL PROTECTED]> wrote:
> I have been doing this wrong for years and getting by with it. What is the
correct way?
>
> I have a field in my SQL Server 2005 PageHits table for the current date
and time. What data format should the field be? What value do I pass from
CF? CreateODBCDateTime(Now))???? I get an error when I try that!

why pass anything from CF?  why not just make the default value of the
field in the database getDate()?

if you're updating...just pass getDate() (just like that.  no quotes,
no # signs (it's a SQL Server function, not a CF function)).

no need to make CF do any thinking :)

-- 

Charlie Griefer

================================================
"...All the world shall be your enemy, Prince with a Thousand Enemies,
and whenever they catch you, they will kill you. But first they must catch
you, digger, listener, runner, prince with a swift warning.
Be cunning and full of tricks and your people shall never be destroyed."



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7 
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs 
http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

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