that the quotes out of the query for the time...

i use something like

update hitclear
set cleardate = #CreateODBCDateTime(Now())#
where table_id = 'reeldemand'


----- Original Message -----
From: "Jacob" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, July 31, 2000 11:34 AM
Subject: Insert date and time into database


> I want to insert the date and time into a sql database. Here is want I am
> trying to do:
>
> <cfset now=createodbcdatetime(now())>
> <cfquery name="resettime" datasource="hits">
> update hitclear
> where table_id = 'reeldemand'
> set cleardate = '#now#'
> </cfquery>
>
> But, I get the following error:
>
> Error Diagnostic Information
> ODBC Error Code = 37000 (Syntax error or access violation)
> [Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the
> keyword 'where'.
> SQL = "update hitclear where table_id = 'reeldemand' set cleardate = '{ts
> '2000-07-31 11:12:22'}'"
> Data Source = "hits"
> SQL = "update hitclear where table_id = 'reeldemand' set cleardate = '{ts
> '2000-07-31 11:12:22'}'"
> The error occurred while processing an element with a general identifier
of
> (CFQUERY), occupying document position (7:1) to (7:44) in the template
file
> D:\html\counter.htm
> The specific sequence of files included or processed is:
> D:\HTML\COUNTER.HTM .
> Date/Time: 07/31/00 11:12:22
>
> I did have it working, but it was almost 8 lines of coding to set the date
> and time.  I Would like to shorten the code to speed up the template.
>
> Any suggestions?
>
> Thanks
> Jacob
>
> --------------------------------------------------------------------------
----
> Archives: http://www.mail-archive.com/[email protected]/
> To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
>

------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to