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

repeat values in query results

Status
Not open for further replies.

Hildegoat15

Technical User
Aug 3, 2001
38
CA
Hi,

I work for a respiratory services company, and I'm trying to generate a query that shows the amount of installs and removals over a certain period of time. I've got 2 queries -- one to count installs and one to count removals.

Installs:

A 4
B 4
C 4
D 5
E 5

Removals:
D 1
E 1

The problem is that when i try to make a third query to put that data together (basically just including those fields in a new query), it repeats the values for some reason, i.e.

inst. rem.
A 4 1
A 4 1
B 4 1
B 4 1

and so on...

why would that be happening? this pry isnt the best way of counting installs and removals, but if you have any suggestions for my problem, i'd appreciate them greatly.
-Matt
 
Hi there

first I am making some assumptions

1 one table contains the installation date and the removal
date
2 that one grouping/aggregate query counts number of
installations /rmovals
3 that another grouping/aggregate query sums number of
removals/installations using previous query as its
data source
if this is the case I can only think that you may have to apply select distinct. But I am loathe to reccomend this with calculations as it can affect the outcome sometimes.

If I have assumed wrongly let me know where I have made an
ASS out of U and ME~

regards

jo


 
thanx for the help, but i think i may have figured it out. i changed up one of the joins to an outer join i think, and it seems to work.

but i'm sure i'll run into another problem, so maybe you're helping me in advance with your suggestion. :) -Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top