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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combine Delete and Select SQL Queries 1

Status
Not open for further replies.

gbobbie

Technical User
Aug 9, 2006
52
US
I need a way to combine two queries in order to run them in unison for a report that needs to call them as a stored procedure. The delete query is as follows:

PARAMETERS [{?LinkReceiver}] Text ( 255 ), [{?DateTime}] DateTime;
DELETE *
FROM TableOfContents
WHERE ((([TableOfContents].[DateTime])<>[{?DateTime}]));

And the select query is as follows:

SELECT *
FROM TableOfContents;

Thank you in advance!

 
Why not base your report on the following query ?
PARAMETERS [{?LinkReceiver}] Text ( 255 ), [{?DateTime}] DateTime;
SELECT *
FROM TableOfContents
WHERE [DateTime] = [{?DateTime}];

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I need to delete from the table based on the parameter fields, but I went a different route and figured it out. Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top