Delete query problem...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to run the following delete query string

DELETE
FROM InfoUSA1 INNER JOIN TPSPA ON (InfoUSA1.areacode=TPSPA.areacode) AND (InfoUSA1.phone=TPSPA.phone)

Where I am trying to delete matching records from the InfoUSA1 table. So if the record on InfoUSA1 table matches the area code and phone on TPSPA table, I want that record deleted

But, I keep getting an error message saying thatI need to Specify the Table I want to delete records from, what am I doing wrong

Thanks!
 
* says all columns from all tables. Try this:

DELETE DISTINCTROW InfoUSA1.*
FROM InfoUSA1 INNER JOIN TPSPA ON (InfoUSA1.areacode=TPSPA.areacode) AND
(InfoUSA1.phone=TPSPA.phone);


--
John Viescas, author
"Microsoft Office Access 2003 Inside Out"
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
http://www.viescas.com/
(Microsoft Access MVP since 1993)
Fred said:
I'm trying to run the following delete query string:

DELETE *
FROM InfoUSA1 INNER JOIN TPSPA ON (InfoUSA1.areacode=TPSPA.areacode) AND (InfoUSA1.phone=TPSPA.phone);

Where I am trying to delete matching records from the InfoUSA1 table. So
if the record on InfoUSA1 table matches the area code and phone on TPSPA
table, I want that record deleted.
But, I keep getting an error message saying thatI need to Specify the
Table I want to delete records from, what am I doing wrong?
 
Fred said:
I'm trying to run the following delete query string:

DELETE *
FROM InfoUSA1 INNER JOIN TPSPA ON (InfoUSA1.areacode=TPSPA.areacode) AND (InfoUSA1.phone=TPSPA.phone);

Where I am trying to delete matching records from the InfoUSA1 table. So if the record on InfoUSA1 table matches the area code and phone on TPSPA table, I want that record deleted.

But, I keep getting an error message saying thatI need to Specify the Table I want to delete records from, what am I doing wrong?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

You have to name the table in the DELETE clause. Try:

DELETE DISTINCTROW InfoUSA1.*
FROM ...

Change the table name to the table you want to delete from.

BE SURE TO BACK UP THE DATA BEFORE DELETING -- JUST IN CASE.

- --
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQF9MoYechKqOuFEgEQJ8zQCfVxjR6NnhHhuW73jc45i9I2ZYuI4AoPvg
inuO/SyKxUuijIQ3VJlc7BBc
=DZwg
-----END PGP SIGNATURE-----
 
I'm trying to run the following delete query string:

DELETE *
FROM InfoUSA1 INNER JOIN TPSPA ON (InfoUSA1.areacode=TPSPA.areacode) AND (InfoUSA1.phone=TPSPA.phone);

Where I am trying to delete matching records from the InfoUSA1 table. So if the record on InfoUSA1 table matches the area code and phone on TPSPA table, I want that record deleted.

But, I keep getting an error message saying thatI need to Specify the Table I want to delete records from, what am I doing wrong?

Thanks!

Answered in modulesdaovba.

PLEASE - if you must post to more than one newsgroup (it's rarely
necessary; this is a Query question and is appropriate here but does
not involve Modules so should not have been posted there), please
crosspost instead of multiposting. Put the desired newsgroups
separated by commas in the Newsgroups line.
 
Back
Top