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

Query criteria from a table 1

Status
Not open for further replies.

kennetha

Programmer
Sep 10, 2003
105
MT
Hi all,

I have a created a query from which I would like to extract data from a table. Once the query is run all table data should be cleared for another run. I don't know much about SQL. Can soneone help me please

Thanks
Kenneth.
 
Hi

Not sure its a good idea, so make a back up, but to "clear" your table (ie delete all records)

DELETE * FROM MyTablenamehere;

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Thanks,
But I may have not explained myself well. What I really want is how to extract (filter, criteria) the query from a table.
 
Hi

Presumably you have created the query in the query grid?

If yes, look down towards the botton of this grid, you will see a row with "Criteria" against in

Move across, the columns, until you come to the column on which you want to apply the criteria, enter the criteria (eg = "A", < 5), depending on what your criteria is

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
yes ok-but I want the criteria to be picked from a table:ie I have created a table(for purpose) with criteria and a query grid to execute

I can do as you explaned but I don't want the user to access the query grid. The criteria is to be changed on a daily bases

Regards
Kenneth

 
Hi

Ok, two ways

1) use a form for the User to Enter the Criteria, in the query grid, include the control of the form as the criteria (in form Forms"YourFormName!YourControlName

Not form must be open at time query runs

2), include the "Criteria" table in the query, and join the two tables on the criteria column

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top