Windsor302
Registered User.
- Local time
- Today, 12:00
- Joined
- Jul 13, 2011
- Messages
- 56
Hey there, I need to count 4 different totals. Using 4 categories and only unique values. I was wondering if I could do all 4 in one query. Thanks
select distinct field1, field2, field3, Category from table1
select count(field1) as countoffield1, count(field2) as countoffield2, count(field3) as countoffield3, Category
from qryUnique
group by category
Where [weld_date] is between #24/07/2011# and #26/07/2011#
SELECT Count([SCOPE 3-COUNT].Weld_No) AS WeldCompleted, Count([SCOPE 3-COUNT].VT_No) AS VTCompleted, Count([SCOPE 3-COUNT].RT_No) AS RTCompleted, Count([SCOPE 3-COUNT].MT_No) AS MTCompleted
FROM [SCOPE 3-COUNT]
Where [SCOPE 3-COUNT].[weld_date] is between #24/07/2011# and #26/07/2011#
SELECT Count([TRO SCOPE 3].Weld_No) AS WeldCompleted, Count([TRO SCOPE 3].VT_No) AS VTCompleted, Count([TRO SCOPE 3].RT_No) AS RTCompleted, Count([TRO SCOPE 3].MT_No) AS MTCompleted
FROM [TRO SCOPE 3]
Where [TRO SCOPE 3].[weld_date] is between #24/07/2011# and #26/07/2011#
SELECT Count([SCOPE 3-COUNT].Weld_No) AS WeldCompleted, Count([SCOPE 3-COUNT].VT_No) AS VTCompleted, Count([SCOPE 3-COUNT].RT_No) AS RTCompleted, Count([SCOPE 3-COUNT].MT_No) AS MTCompleted
FROM [SCOPE 3-COUNT] inner join [TRO SCOPE 3] on [SCOPE 3-COUNT].ID = [TRO SCOPE 3].ID
Where [TRO SCOPE 3].[weld_date] is between #24/07/2011# and #26/07/2011#