I'm getting a syntax error with this INSERT statement. Does anything jump out at anyone? I can't find anything wrong. Could it be a date or time format problem? All fields match. Would an UPDATE QUERY be required if I'm AUTONumbering the ID field and not passing it from the form?
I have this exact code working with another form but the fields and datasource are different. It also has the Date and Time as one field instead of separated into two. I'm working with existing data so I can't change date and time to one field (which would be my preference).
Thanks.
Sherylj
<CFSET time = #CreateODBCTime(Now())#>
<CFQUERY NAME="AddWellData" DATASOURCE="sdwreport" dbtype="ODBC">
INSERT INTO emailReportingform (Date, Time, Yard, wellname, Operator, Appearance, Road, Spills, Stairs, Hatches, Rock_Boxes, Leaks, Dlpump, PDpump1, Oiler, Belts, PDpump2, Well, Well_lines, Head, Shutoffs, Pops, DateSold, Temp, Gravity, Grossbbl, BS_W, Ticket, Totalbbl, pTk1, pTk2, pTk3, pTotalbbl, ohTk1, ohTk2, ohTk3, ohTotalbbl, swoTk1, swoTk2, swoTk3, swoTk4, swoTk5, swoTk6, swoTk7, swoTk8, swoTk9, swoTk10, swoTk11, swoTk12, swoTotalbbl, GBTk1, swtTk2, swtTk3, swtTk4, swtTk5, swtTk6, swtTk7, swtTk8, swtTk9, swtTk10, swtTk11, swtTk12, swtTotalbbl, BBLpumpedYD, TubingPsi, BBLpumpTD, annularPsi, TBBlmonth, pitskimed, Comments)
VALUES ('#DateFormat(Now(),"mm dd, yy"
#', '#time#', '#Form.Yard#', '#Form.wellname#', '#Form.Operator#', '#Form.Appearance#', '#Form.Road#', '#Form.Spills#', '#Form.Stairs#', '#Form.Hatches#', '#Form.Rock_Boxes#', '#Form.Leaks#', '#Form.Dlpump#', '#Form.PDpump1#', '#Form.Oiler#', '#Form.Belts#', '#Form.PDpump2#', '#Form.Well#', '#Form.Well_lines#', '#Form.Head#', '#Form.Shutoffs#', '#Form.Pops#', '#Form.DateSold#', '#Form.Temp#', '#Form.Gravity#', '#Form.Grossbbl#', '#Form.BS_W#', '#Form.Ticket#', '#Form.Totalbbl#', '#Form.pTk1#', '#Form.pTk2#', '#Form.pTk3#', '#Form.pTotalbbl#', '#Form.ohTk1#', '#Form.ohTk2#', '#Form.ohTk3#', '#Form.ohTotalbbl#', '#Form.swoTk1#', '#Form.swoTk2#', '#Form.swoTk3#', '#Form.swoTk4#', '#Form.swoTk5#', '#Form.swoTk6#', '#Form.swoTk7#', '#Form.swoTk8#', '#Form.swoTk9#', '#Form.swoTk10#', '#Form.swoTk11#', '#Form.swoTk12#', '#Form.swtTotalbbl#', '#Form.BBLpumpedYD#', '#Form.TubingPsi#', '#Form.BBLpumpTD#', '#Form.annularPsi#', '#Form.TBBlmonth#', '#Form.pitskimed#', '#Form.Comments#')
</CFQUERY>
Error Message is.....
ODBC Error Code = 37000 (Syntax error or access violation)
[Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.
Data Source = "sdwreport"
The error occurred while processing an element with a general identifier of (CFQUERY), occupying document position (6:1) to (6:65) in the template file c:\inetpub\
I have this exact code working with another form but the fields and datasource are different. It also has the Date and Time as one field instead of separated into two. I'm working with existing data so I can't change date and time to one field (which would be my preference).
Thanks.
Sherylj
<CFSET time = #CreateODBCTime(Now())#>
<CFQUERY NAME="AddWellData" DATASOURCE="sdwreport" dbtype="ODBC">
INSERT INTO emailReportingform (Date, Time, Yard, wellname, Operator, Appearance, Road, Spills, Stairs, Hatches, Rock_Boxes, Leaks, Dlpump, PDpump1, Oiler, Belts, PDpump2, Well, Well_lines, Head, Shutoffs, Pops, DateSold, Temp, Gravity, Grossbbl, BS_W, Ticket, Totalbbl, pTk1, pTk2, pTk3, pTotalbbl, ohTk1, ohTk2, ohTk3, ohTotalbbl, swoTk1, swoTk2, swoTk3, swoTk4, swoTk5, swoTk6, swoTk7, swoTk8, swoTk9, swoTk10, swoTk11, swoTk12, swoTotalbbl, GBTk1, swtTk2, swtTk3, swtTk4, swtTk5, swtTk6, swtTk7, swtTk8, swtTk9, swtTk10, swtTk11, swtTk12, swtTotalbbl, BBLpumpedYD, TubingPsi, BBLpumpTD, annularPsi, TBBlmonth, pitskimed, Comments)
VALUES ('#DateFormat(Now(),"mm dd, yy"
</CFQUERY>
Error Message is.....
ODBC Error Code = 37000 (Syntax error or access violation)
[Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.
Data Source = "sdwreport"
The error occurred while processing an element with a general identifier of (CFQUERY), occupying document position (6:1) to (6:65) in the template file c:\inetpub\