Only delete certain fields in Delet Query

moishinetzer

New member
Local time
Today, 12:33
Joined
Mar 17, 2016
Messages
2
I am making a delete query that i want to only delete certain fieds (more explained below)

Table1
PHP:
    OneID ¦ Data
    1        ¦ 3
    2        ¦ 5
Table2
PHP:
    OneID ¦ Random
    1        ¦ 25
    2        ¦ 29
i want to delete all records in Table2 where Data in Table1 is 3
One other thing i dont want to use SQL... only in-built access functions

My problem is, when i add all the tables it doesnt know which table i want to delete all the records from as i have two fields from two tables joined together in one query as to compare them (Data)

How can i do this just with access' functions/options?
 
Access tables speak SQL. You can't really do this kind of thing efficiently without using SQL. I would try something like . . .
Code:
DELETE FROM Table2 WHERE OneID IN ( SELECT OneID FROM Table1 WHERE Data = 3 )
See what's going on there?
 
Access tables speak SQL. You can't really do this kind of thing efficiently without using SQL. I would try something like . . .
Code:
DELETE FROM Table2 WHERE OneID IN ( SELECT OneID FROM Table1 WHERE Data = 3 )
See what's going on there?

GREAT! thanks, however, what if the situation was where the table i wanted to delete from was in a separate directory, how would i reference that using the SQL notation
 
DELETE FROM table2 IN 'D:\folder\databaseName.accdb' WHERE OneID IN (SELECT OneID FROM table1 WHERE Data = 3);
 

Users who are viewing this thread

Back
Top Bottom