Delete query with date criteria

Moore71

DEVELOPER
Local time
Today, 20:05
Joined
Jul 14, 2012
Messages
158
Hi,
i have 2tables,table1 id,name, table2 id,name,date.
How can i write a delete query that will delete everything in table2,if the data date is today?
Please i need sql statement or vba code
thanks
 
I would use the Query wizard to build the code.
However at a guess

DELETE * from Table2 where table2.date = date()

the query wizard would give me this for my Dates table (substitute your table name and field names)

DELETE Dates.On_Date, Dates.*
FROM Dates
WHERE (((Dates.On_Date)=Date()));
 
Oops, too slow.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom