the syntax is 

UPDATE hitclear
SET cleardate = '#now()#'
WHERE table_id = 'reeldemand'

you have the set and where clauses reversed.

Chris Olive,
DOEHRS Website Administrator 

-----Original Message-----
From: Jacob [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 31, 2000 2:34 PM
To: [EMAIL PROTECTED]
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/cf-talk@houseoffusion.com/
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/cf-talk@houseoffusion.com/
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