Joining 2 Queries

  • Thread starter Thread starter carl
  • Start date Start date
C

carl

I have 2 queries:

Query1
SELECT (count(TradeVolume)/2) AS TotalVolume
FROM HILLTOP;

Query2
SELECT (sum(TradeVolume)/2) AS TotalVolume
FROM HILLTOP;

Trying to combine the 2 and get output like this:

Total_Volume:_Result of Query1
Total_Trades:_Result of Query2

Thank You in Advance.
 
select query1.totalvolume as Total_Volume, query2.totalvolume as
total_trades
from query1,query2

note that query will only work if you have a single value in each
table but from the appears of the queries you do so there should be no
problem

hope this helps

Regards
Kelvan
 
I'm confused...

From your description, you appear to be counting the number of records with
[TradeVolume] entries and dividing by two, calling it "Total Volume".

Then you are summing all the values contained in [TradeVolume] and dividing
by two, and calling THAT "Total Volume".

So, what is it, the count or the sum? (and why divide by 2?)

More info, please...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Why not do it this way ---
SELECT (count(TradeVolume)/2) AS Total_Volume, (sum(TradeVolume)/2) AS
Total_Trades
FROM HILLTOP;
 
Back
Top