DELETE statement

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Carcus
    New Member
    • Jul 2007
    • 4

    #1

    DELETE statement

    Hi

    I hope someone can help me with this one. I am writing a DELETE statement to run on a query I have set up called [Employees Paylsip to Home Address]. I'm trying to delete all records with a [From] and [To] date that are matching.

    I'm currently getting an error message saying "The expression you entered contains invalid syntax. You may have entered an operand without an operator." - I don't even know what this last line of the message means.


    Here is my incorrect SQL- (this is most likely totally all over the place as I'm flying blind here!!).



    Expr1: ([DELETE]*FROM([Employees Payslip to Home Address]WHERE([From]=[To]))
  • missinglinq
    Recognized Expert Specialist
    • Nov 2006
    • 3533

    #2
    You have inadvertently posted your question in the Access Articles Section! I have moved it to the Access Forum.

    Welcome to TheScripts!

    Linq ;0)>

    Comment

    • abolos
      New Member
      • Apr 2007
      • 65

      #3
      Originally posted by Carcus
      Hi

      I hope someone can help me with this one. I am writing a DELETE statement to run on a query I have set up called [Employees Paylsip to Home Address]. I'm trying to delete all records with a [From] and [To] date that are matching.

      I'm currently getting an error message saying "The expression you entered contains invalid syntax. You may have entered an operand without an operator." - I don't even know what this last line of the message means.


      Here is my incorrect SQL- (this is most likely totally all over the place as I'm flying blind here!!).



      Expr1: ([DELETE]*FROM([Employees Payslip to Home Address]WHERE([From]=[To]))
      The sql statement must be like: Delete * from tblnameage where stAge between 1 and 20

      Comment

      • JKing
        Recognized Expert Top Contributor
        • Jun 2007
        • 1206

        #4
        Originally posted by Carcus
        Hi

        I hope someone can help me with this one. I am writing a DELETE statement to run on a query I have set up called [Employees Paylsip to Home Address]. I'm trying to delete all records with a [From] and [To] date that are matching.

        I'm currently getting an error message saying "The expression you entered contains invalid syntax. You may have entered an operand without an operator." - I don't even know what this last line of the message means.


        Here is my incorrect SQL- (this is most likely totally all over the place as I'm flying blind here!!).



        Expr1: ([DELETE]*FROM([Employees Payslip to Home Address]WHERE([From]=[To]))
        I don't believe you can delete records from a query. DELETE statements are usually placed on a table. Though you may have misworded this or I've misunderstood but is [Employees Payslip to Home Address] a saved query? If so what is the table you're trying to DELETE records from? OR do you just want to filter your query so that it does not show records where [FROM] = [TO].

        Comment

        • Carcus
          New Member
          • Jul 2007
          • 4

          #5
          Originally posted by abolos
          The sql statement must be like: Delete * from tblnameage where stAge between 1 and 20

          Thanks for your help with that one - I'll give that a try!

          Comment

          • Carcus
            New Member
            • Jul 2007
            • 4

            #6
            Originally posted by JKing
            I don't believe you can delete records from a query. DELETE statements are usually placed on a table. Though you may have misworded this or I've misunderstood but is [Employees Payslip to Home Address] a saved query? If so what is the table you're trying to DELETE records from? OR do you just want to filter your query so that it does not show records where [FROM] = [TO].

            Thaks for your help. I was wondering about that query/table thing myself. I was trying to use the Delete statement in a query. I'll try again using it in a table. I spoke to someone who also mentioned about just adding a similar filter.


            I'll go and give these a try.

            Thanks again - great to get good help on my 1st posting.

            Comment

            • Carcus
              New Member
              • Jul 2007
              • 4

              #7
              Originally posted by missinglinq
              You have inadvertently posted your question in the Access Articles Section! I have moved it to the Access Forum.

              Welcome to TheScripts!

              Linq ;0)>

              I think I have been shot witht the stupid gun!! Thanks for moving that for me!!

              Comment

              Working...