Board index » delphi » Accessing TQuery from another TQuery's SQL

Accessing TQuery from another TQuery's SQL

Is it possible to access a TQuery from another TQuery's SQL ?
Fro example I have a (a)Query neatly set up with fields from different
tables and complicated 'where...' clause. Now I just want to have another
SQL (b)query run on it to calculate eg. Summaries of fields, averages, etc.
To re-create the whole 'select...,from...' query just to get a sum of a
field seems like a lot of overkill for me (coding and performance wise). Any
way I can access an allready set-up query(a) in the SQL (from...) of another
query(b)?

Note: (b) must be SQL and can't be a "for i:=0 to recordCount-1 do.." thing.

Any help appreciated.

 

Re:Accessing TQuery from another TQuery's SQL


No. You cannot query a query.

--
Bill

Bill Todd (TeamB)
(TeamB cannot respond to questions received via email)

Re:Accessing TQuery from another TQuery's SQL


You'll have to make your query permanent. See below (in 11/18) under 'How to
save query results'.

elio

Other Threads