Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Delete with WHERE Clause.

Delete with WHERE Clause.

Delete with WHERE Clause.

Need some help here. Why is this not working?

DELETE FROM HR_021_Isolates_Records_For_Anniversary_Reset_Table WHERE HR_021_Isolates_Records_For_Anniversary_Reset_Table.Code="Unpaid" AND HR_021_Isolates_Records_For_Anniversary_Reset_Table.UTimeTaken=Null AND HR_021_Isolates_Records_For_Anniversary_Reset_Table.OFTimeTaken=Null;

RE: Delete with WHERE Clause.

Jet SQL requires DELETE * FROM instead of DELETE FROM that works for most other versions of SQL.

RE: Delete with WHERE Clause.

In addition to Axworthy’s reply, you shouldn’t use "=Null". Always use "is Null".

CODE -->

HR_021_Isolates_Records_For_Anniversary_Reset_Table.UTimeTaken is Null AND
HR_021_Isolates_Records_For_Anniversary_Reset_Table.OFTimeTaken is Null; 

Hook'D on Access
MS Access MVP 2001-2016

RE: Delete with WHERE Clause.

To see the record(s) you want to Delete, it is beneficial to Select them first just to make sure you will delete record(s) you want:
If you do:

* FROM HR_021_Isolates_Records_For_Anniversary_Reset_Table
WHERE Code = "Unpaid"
AND UTimeTaken Is Null
AND OFTimeTaken Is Null;

and if that looks OK, then just change Select to Delete

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson

RE: Delete with WHERE Clause.

Thanks you both. I must of copied and pasted the code incorrectly I did have DELETE * in there but fixing the null did the trick.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close