Rollup query

polina

Registered User.
Local time
Today, 11:23
Joined
Aug 21, 2002
Messages
100
I have one table

RecID Transit USRoaming
1 1 yes
2 1 no
3 4 no

Another table

Regular Charges USRoaming Charges
100 120

I need to rollup all the transits
so I would get

Transit Charges
1 220
4 100


Please suggest the SQL

Thanks
 
Copy this to the SQL view of a new Query:

SELECT [Table01].Transit, Sum(IIf([USRoaming]=True,[USRoaming Charges],[Regular Charges])) AS Amt
FROM [Table01], [Table02] GROUP BY [Table01].Transit;

You will need to change the Table Names

[Table01]=Your First Table
[Table02]=Your Second Table
 

Users who are viewing this thread

Back
Top Bottom