stephenlecomptejr
asked on
Need help with run time error 3075 - syntax error for SQL Statement.
Need help with identifying syntax error:
Here's the output of SQL string:
Please note image of syntax error message
sql-syntax-msg.PNG
Here's the output of SQL string:
DELETE tempTimesheetWeek.PMHours, tempTimesheetWeek.AMHours, tempTimesheetWeek.[08WorkDate], tempTimesheetWeek.[01WorkDate] FROM tempTimesheetWeek WHERE (tempTimesheetWeek.PMHours = 0 Or tempTimesheetWeek.PMHours IsNull) AND tempTimesheetWeek.AMHours >0 AND tempTimesheetWeek.[01WorkDate] = #12/13/2018#
Please note image of syntax error message
sql-syntax-msg.PNG
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Just to be clear, you cannot delete specific fields in a table. You delete ROWS, i.e. the entire row.
Other than that, I would stick to using Is Null, which is plan SQL and doesn't involving function calls. It is faster.
Other than that, I would stick to using Is Null, which is plan SQL and doesn't involving function calls. It is faster.
DELETE FROM tempTimesheetWeek WHERE (tempTimesheetWeek.PMHours = 0 Or tempTimesheetWeek.PMHours Is Null) AND tempTimesheetWeek.AMHours >0 AND tempTimesheetWeek.[01WorkDate] = #12/13/2018#
ASKER
Appreciate everyone's replies. Thanks for the help!
Open in new window