473,395 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

DELETE statement

4
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]))
Jul 26 '07 #1
6 1871
missinglinq
3,532 Expert 2GB
You have inadvertently posted your question in the Access Articles Section! I have moved it to the Access Forum.

Welcome to TheScripts!

Linq ;0)>
Jul 26 '07 #2
abolos
65
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
Jul 26 '07 #3
JKing
1,206 Expert 1GB
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].
Jul 26 '07 #4
Carcus
4
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!
Jul 26 '07 #5
Carcus
4
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.
Jul 26 '07 #6
Carcus
4
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!!
Jul 26 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

14
by: php newbie | last post by:
I am getting error messages when I try to delete from a table using the values in the table itself. The intent is to delete all rows from TableA where col_2 matches any of the col_1 values. ...
4
by: Stefan Strasser | last post by:
why is delete an expression and not a statement? (in my draft copy of the standard). I was about to ask the same question about "throw" but found an expression case of throw("return boolvalue ? 5...
16
by: robert | last post by:
been ruminating on the question (mostly in a 390/v7 context) of whether, and if so when, a row update becomes an insert/delete. i assume that there is a threshold on the number of columns of the...
4
by: AlanAylett | last post by:
Hi all wondering if anybody could spot anything wrong with this SQL DELETE statement, both my Access and SQL skills are not what they used to be so i reckon its something simple, any suggestions...
6
by: polocar | last post by:
Hi, I'm writing a program in Visual C# 2005 Professional Edition. This program connects to a SQL Server 2005 database called "Generations" (in which there is only one table, called...
1
by: Matt | last post by:
I am writing a DELETE statement and I want to filter the records using another SELECT statement. My SELECT statement is a GROUP BY query that grabs all social security numbers from the "Data...
12
by: yufufi | last post by:
Hello, How does delete know how much memory to deallocate from the given pointer? AFAIK this informations is put there by new. new puts the size of the allocated memory before the just before...
3
by: atrottier | last post by:
I'am new here so I'd like to say hello and this seems to be a great site it has already helped me a few times. I just got an assignment to correct and modify a simple access application. First some...
1
by: codedhacker | last post by:
I have a piece of code that uses the db-library with sql server 2000/2005 and runs the following delete statement: DELETE FROM TABLE1 WHERE COL1 IN( 'Some Val1' ) AND COL2 IN( 'Some Val2' )...
8
by: Michel Esber | last post by:
Hello, Env: DB2 V8 LUW FP16 running Linux create Table X (machine_id varchar(24) not null, ctime timestamp not null); create index iFoo on X (MACHINE_ID, CTIME) allow reverse scans; alter...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.