I am trying to insert some data but before it insterts I've setup an cfif Isdefined(name_of_field) statement that checks to see if a box is checked, if the box is checked it goes out and populates a field but it is not working.Below is my code and the error message I get when trying to do this procedure.
<cfquery datasource="database">
INSERT INTO table
(TypeofCall, Problem, Solution, TypeofProblem,
AssignedTo, Status, UserID, date
<cfif IsDefined("start_of_ticket"
>,start_of_ticket</cfif>)
VALUES
('#TypeofCall#', '#Problem#', '#Solution#', '#TypeofProblem#',
'#AssignedTo#', '#Status#', '#UserID#', #CreateODBCDateTime(Now())#
<cfif IsDefined("start_of_ticket"
>, #CreateODBCDateTime(Now())#</cfif>)
</cfquery>
Error Diagnostic Information
ODBC Error Code = 37000 (Syntax error or access violation)
[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'VALUES'.
The error occurred while processing an element with a general identifier of (CFQUERY), occupying document position (1:1) to (1:32).
Date/Time: 08/18/00 13:37:16
Browser: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT; CNETHomeBuild051099; DigExt)
Remote Address: 164.67.121.130
HTTP Referer:
<cfquery datasource="database">
INSERT INTO table
(TypeofCall, Problem, Solution, TypeofProblem,
AssignedTo, Status, UserID, date
<cfif IsDefined("start_of_ticket"
VALUES
('#TypeofCall#', '#Problem#', '#Solution#', '#TypeofProblem#',
'#AssignedTo#', '#Status#', '#UserID#', #CreateODBCDateTime(Now())#
<cfif IsDefined("start_of_ticket"
</cfquery>
Error Diagnostic Information
ODBC Error Code = 37000 (Syntax error or access violation)
[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'VALUES'.
The error occurred while processing an element with a general identifier of (CFQUERY), occupying document position (1:1) to (1:32).
Date/Time: 08/18/00 13:37:16
Browser: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT; CNETHomeBuild051099; DigExt)
Remote Address: 164.67.121.130
HTTP Referer: