Copying a query to another query 
Author Message
 Copying a query to another query

Hello all,

Is there a way to duplicate a query? I am trying this path because I
have a query that is already filtered and I don't want to re-create the
SQL again to be used in another query (which will be used as a source
for reporting.)

--Eddy



Wed, 18 Jun 1902 08:00:00 GMT  
 Copying a query to another query
Hi Eddy, try this:

Query2.SQL.Assign(Query1.SQL).

This statement copies the Strings of SQL (Query1) to the strings of SQL
(Query2).

Yours, Volker

Eddy Young schrieb:

Quote:

> Hello all,

> Is there a way to duplicate a query? I am trying this path because I
> have a query that is already filtered and I don't want to re-create the
> SQL again to be used in another query (which will be used as a source
> for reporting.)

> --Eddy

--
Volker Fraenkle                         CS Controlling
Technical Consultant                    Software Systeme GmbH


Phone:  +49 7144 8144-0                 Riedbachstrasse 5
Fax:    +49 7144 8144-10                D-74385 Pleidelsheim



Wed, 18 Jun 1902 08:00:00 GMT  
 Copying a query to another query

Quote:

> Hello all,

> Is there a way to duplicate a query? I am trying this path because I
> have a query that is already filtered and I don't want to re-create the
> SQL again to be used in another query (which will be used as a source
> for reporting.)

If you wanted the dataset and everything else, you could of course
maintain
a "worker" query and just assign it at runtime:

Query1 := Query2;

HTH
Rkr

--
                   \|||/
                   /'^'\
                  ( 0 0 )
--------------oOOO--(_)--OOOo--------------
. Reid Roman                              .
. Delphi Programmer / Analyst             .
. TVisualBasic:=class(None)               .
. May the Source be With You              .
-------------------------------------------
. Auto-By-Tel (http://www.autobytel.com)  .
. Irvine, CA U.S.A                        .
. E-Mail : rkroman (at) home (dot) com    .
-------------------------------------------



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Copying fields/records from query to table

2. Copying Query Data Into a Table (without using insert - into)

3. Join Query Record in the same Query...

4. Query from Query

5. Querying a query?

6. Querying output from another query

7. Query on a query?

8. UK query - Delphi3 - NT4-Memory leak on SQL Query to SQL/server 6.5

9. query on query

10. URG: re-query a query

11. Query Component query?

12. UPDATE QUERY WORKS BUT CANT SEE CHANGES IN OTHER QUERY

 

 
Powered by phpBB® Forum Software