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

one query from two queries problem

Status
Not open for further replies.

ajking

Technical User
Aug 13, 2002
229
there is probably a simple answer to this but at the moment my brain has powered down and not rebooted yet!
I have two tables (1)"Cust_Details" and (2)"Daily log".
"Cust_Details" lists individual customers,item, date ordered, Value of order,Payment received etc.
"Daily Log" is for telesales and lists: Total_Calls_Made, Total_Orders_taken, Date
I have set up a query for table (1) which will give me Total_Value and Total_Payments between two dates(selected by user) this works fine
similarly I have set up a query for table (2) with the same criteria, which also works fine.
What I need is to take the results of both queries using the same date criteria and put into a single report.Any help would be much appreciated. TIA.

'Life is what happens to you while you are busy making other plans' John W. Lennon 1940-1980
 
You can use a Union Query. A basic example:

[tt]Select Total_Value, Total_Payments From Cust_Details
Where OrderDate=Date()
Union All
Select Total_Value, Total_Payments From Daily Log
Where OrderDate=Date()[/tt]
 
Make SubReport with the second query and insert it in the main report.
 
How are ya ajking . . .

Since [blue]we don't know the full complement of fields per table[/blue], setting up a [blue]union query[/blue] could get very tough, particularly in lining up data types.

Easier (right off the bat) would be the [blue]subreport[/blue] suggested by [blue]orna![/blue]

[blue]Your Thoughts? . . .[/blue]

Calvin.gif
See Ya! . . . . . .
 
Many thanks. I will probably go down the subreport road as suggested by Orna. once again thank you all for your advice.

'Life is what happens to you while you are busy making other plans' John W. Lennon 1940-1980
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top