Hi all,
Can anyone help me with this,
I am inserting dates into a database using the custom tag dateSelect,
<cfset form.datefrom=#createDate(displayYear,displayMonth,displayDay)#>
<cfset form.dateTo=#createDate(displayYearTo,displayMonthTo,displayDayTo)#>
<cfquery name="qry_insertNewLog" datasource="#application.dsn#"
username="#application.gateway#" password="#application.key#">
INSERT INTO dbo.milfordLog (dt,
Username,
Status,
Duration,
sampleInterval,
dateFrom,
dateTo,
timeFrom,
timeTo)
VALUES
(#createODBCDateTime(now())#,
'#session.checkMilfordLogin#',
#databaseStatus#,
#Duration#,
#level#,
#dateFrom#,
#dateTo#,
'#timeFrom#',
'#timeTo#')
</cfquery>
thats fine,
but if I update (I'm not changing the dates just one int field type)
<cfquery name="qry_updateSampleState" datasource="#application.dsn#"
username="#application.gateway#" password="#application.key#">
UPDATE dbo.sampler_status
SET
Username='#qry_getSampleState.Username#',
Status=#qry_getSampleState.Status#,
Duration=#qry_getSampleState.Duration#,
sampleInterval=#qry_getSampleState.sampleInterval#,
dateFrom=#qry_getSampleState.dateFrom#,
dateTo=#qry_getSampleState.dateTo#,
timeFrom='#qry_getSampleState.timeFrom#',
timeTo='#qry_getSampleState.timeTo#',
location='#qry_getSampleState.location#'
WHERE id = 1
</cfquery>
I get this error
ODBC Error Code = 37000 (Syntax error or access violation)
[Microsoft][ODBC SQL Server Driver][SQL Server]Line 6: Incorrect syntax near
'00'.
SQL = "UPDATE dbo.sampler_status SET Username='margaret ', Status=5.00,
Duration=60.00, sampleInterval=1.00, dateFrom=28/03/01 00:00:00,
dateTo=28/03/01 00:00:00, timeFrom='13:00 pm ', timeTo='14:00 pm ',
location='inlet' WHERE id = 1"
mmmmm puzzled I'd appreciate any help with this at all.
John
Derry (N.Ireland)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists