Using Queries in an other Query


Hello.
I want to use or call a query I created, from a new query, like if it was a table. Something like this -->

Query Base

Select * from table1



Query New

Select * from Base
where Base.Id = 2


This is just an example, what I need to do is much more complicated, but I thought I could use my owns queries like any table from my database, and it doesn`t work. Is there something I need to do to have this option? or is just not possible to do it.

Comments

  • edited 2:18AM
    You didn't say enough to describe your issue. But I guess you need to use master-detail relation between two queries. If so give a real exmaple we can work on here or have a look at compiled demo for master-detail reports.

    Mick
  • FRNLFRNL Hoogeveen - Netherlands
    edited 2:18AM
    Mememe wrote: »
    Hello.
    I want to use or call a query I created, from a new query, like if it was a table. Something like this -->

    Query Base

    Select * from table1



    Query New

    Select * from Base
    where Base.Id = 2


    This is just an example, what I need to do is much more complicated, but I thought I could use my owns queries like any table from my database, and it doesn`t work. Is there something I need to do to have this option? or is just not possible to do it.

    What you describe looks like inheritance. I wonder if this at the level of report inheritance.

    But in the 'Query New', I would say: if you need the SQL from the first query, put "Query Base" SQL in a variable and add the condition from code or after a select.

    Best regards,
    Teo

Leave a Comment