This topic is locked

Running the same query against different tables in one report

1/25/2008 10:54:50 AM
PHPRunner General questions
D
dphipson author

Hi,
I've got two tables that are identical - they contain the same information except for one field in the second table. The first table - proposals - contains information which, once confirmed, is copied to the second table - orders.
I've produced a query that I used in a custom view. The query runs against the first table. I want to run the same query against the second table in the same custom view. Is this possible?
When a proposal is confirmed it generates an order in the second table and leaves the proposal in the proposal table. The proposal record contains a proposal number and an order number. Until an order is generated the order number on the proposal record is zero. As soon as the order is generated the order number generated is stored in the order number field on the proposal record. I need to create a query/custom view that shows all the orders from the order table and those proposals that haven't yet been converted to an order - i.e. the order number against the proposal record is zero.
Thanks for reading this post and I hope you can help.
Cheers,
Darren

J
Jane 1/28/2008

Darren,
to filter records for the proposal view add where clause to your SQL query on the Edit SQL query tab.

Here is a sample:

select field1,

field2,

...

from tablename

where order_number=0