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:

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#

Open in new window


Please note image of syntax error message
sql-syntax-msg.PNG
LVL 1
stephenlecomptejrAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

bfuchsCommented:
change isnull to is null
DELETE tempTimesheetWeek.PMHours, tempTimesheetWeek.AMHours, tempTimesheetWeek.[08WorkDate], tempTimesheetWeek.[01WorkDate] FROM tempTimesheetWeek WHERE (tempTimesheetWeek.PMHours = 0 Or tempTimesheetWeek.PMHours Is Null)  AND tempTimesheetWeek.AMHours >0 AND tempTimesheetWeek.[01WorkDate] = #12/13/2018#

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ste5anSenior DeveloperCommented:
Simplify it:

DELETE FROM tempTimesheetWeek
WHERE Nz(PMHours, 0) = 0 AND AMHours > 0 AND [01WorkDate] = #12/13/2018#;

Open in new window

Anders Ebro (Microsoft MVP)Microsoft DeveloperCommented:
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.

DELETE FROM tempTimesheetWeek WHERE (tempTimesheetWeek.PMHours = 0 Or tempTimesheetWeek.PMHours Is Null)  AND tempTimesheetWeek.AMHours >0 AND tempTimesheetWeek.[01WorkDate] = #12/13/2018#

Open in new window

stephenlecomptejrAuthor Commented:
Appreciate everyone's replies.  Thanks for the help!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.