Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can you combine two statements in one query

Status
Not open for further replies.

DougP

MIS
Dec 13, 1999
5,985
US
I need to delete all records each time prior to running the insert query.
Code:
Delete From TempProjectsNotLoggedOut    INSERT INTO TempProjectsNotLoggedOut ( [Project Number], ...
Can this be done in one query?
It gives error

DougP, MCP, A+
 
Some DBMS systems permit constructs like
Code:
Delete From tbl[red]; [/red]INSERT INTO ...
Unfortunately, Access isn't one of them. You will need to use two statement and run them in sequence or write a stored procedure to do the delete followed by the insert.
 
Can this be done in one query
No, access doesn't admit multiple QL instructions.
You may consider a make table query:
SELECT ... INTO TempProjectsNotLoggedOut
FROM ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top