Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Nov 2001
    Posts
    192
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Delete except one (Access 2000)

    I want to delete everything in the tables Students except the records
    for the student with ID number = 1.
    How can i do it ?
    The code i tried and failed was :

    Dim SQL As String
    DELETE * FROM Students WHERE StudentID <>t 1 "
    what i mean is that student is not = 1,but i do not know how to express it

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Delete except one (Access 2000)

    Why do you have a "t" in WHERE StudentID <>t 1 ? Without the "t" it should work OK.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •