Two Queries

durdle

Registered User.
Local time
Today, 05:30
Joined
May 7, 2002
Messages
130
Tough question,

I have two queries that simply cannot be put together. The end result I would prefer is to have both queries together in an excel file. Any ideas on how I would accomplish this, I understand the transfersheet action but not sure if that is the way to go.

Thanks for any help

durdle
________
buy silversurfer vaporizer
 
Last edited:
If you right-click on the query in the database window, there is a menu option to export it to whatever format you like. So you can easily get the query result into an Excel sheet.
 
Why can't they be put together? Is the data completely different? Can you use a Union Query to put the queries together? Then do a:
DoCmd.OutputTo acOutputQuery, "Qry_YourUnion", acFormatXLS

??
 
Thanks samehkh but user's will be using the db.

pdx_man,
The data is not completely different it is just that I cannot get the query to work. Here is the skinny on it. Three tables, tblone has primary field id, tbltwo has not distinctive field but it has the id field, tblthree has no distinctive field but it has id. I want to collect data on a daily basises, and in tblthree for any given day the id field can have duplicate entries. In tbltwo the id field is only there once for each day, so basically when the query runs through the records it picks up id 234 on 08/14/03 in tbltwo, then it goes to tblthree and id 234 is there twice for 08/14/03, and counts the field twice for that id.

make sense
attached is a view of the query.

durdle
________
vaporizer wholesale
 

Attachments

Last edited:
Before using a Totalss query, be sure that you have the recordset that you want. This may require creating a query first using the first two tables, then another query where you join the third table to the newly created query. THEN, create your Totals query based on this.
 
Hey again pdx_man,

But I am not sure what you mean?

This querry is crazy!

durdle
________
smoking kills
 
Last edited:
Anyone want to take a stab at this

Hey,


I have a sample attached which will make this more clear to understand. The query will bring back stats between 08/03/03 and 08/09/03 for id 2490. The field that I am having trouble with is the Dispo_Count field. I want the field to sum all the dispos between those two dates, but it is not doing that. What it is doing is that for each date in Table b it is adding the dispo twice, you will notice that on the dates 08/07/03, 08/05/03 & 08/04/03(In Table b these dates have two entries). So in the query the Dispo_Count is showing 248 but is should be 136. So for the dates 08/07/03 - 37; 08/05/03 - 35; 08/04/03 - 40 it is adding them twice.

Breakdown 136+37+35+40 = 248

Please Help
________
sell vaporizers
 

Attachments

Last edited:
Take a look at what I've attached here and you can see what I was talking about above.
 

Attachments

Users who are viewing this thread

Back
Top Bottom