Connecting Tech Pros Worldwide Forums | Help | Site Map

DELETE statement

Newbie
 
Join Date: Jul 2007
Posts: 4
#1: Jul 26 '07
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's Avatar
Moderator
 
Join Date: Nov 2006
Location: Richmond, Virginia USA
Posts: 3,000
#2: Jul 26 '07

re: DELETE statement


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

Welcome to TheScripts!

Linq ;0)>
Member
 
Join Date: Apr 2007
Posts: 65
#3: Jul 26 '07

re: DELETE statement


Quote:

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
JKing's Avatar
Moderator
 
Join Date: Jun 2007
Location: Niagara Falls, Ontario
Posts: 557
#4: Jul 26 '07

re: DELETE statement


Quote:

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].
Newbie
 
Join Date: Jul 2007
Posts: 4
#5: Jul 27 '07

re: DELETE statement


Quote:

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!
Newbie
 
Join Date: Jul 2007
Posts: 4
#6: Jul 27 '07

re: DELETE statement


Quote:

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.
Newbie
 
Join Date: Jul 2007
Posts: 4
#7: Jul 27 '07

re: DELETE statement


Quote:

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!!
Reply