SELECT E.AccountId ,P.Operational
,FLOOR(SUM(AmountPTY)) AS Total_Amount
,FLOOR(SUM(AmountPTY) / 250) NumberOfDeposits
FROM ECos E
INNER JOIN PlayerDetails P ON P.AccountId = E.PlayerId
INNER JOIN PlayerLevel L ON L.id = P.PlayerLevelId
WHERE TxnTime BETWEEN '2010-08-01 00:00:00.000' AND '2010-08-31 23:59:59.997'
AND TxnDescriptor = 'D'
GROUP BY
E.AccountId
,P.Operational
AND
SELECT c.AccountId, P.Operational
,FLOOR(SUM(BetAmtPTY)) AS Total_Amount
,FLOOR(SUM(BetAmtPTY)/250) NumberOfWagers
FROM CasinoG c
INNER JOIN PlayerDetails P ON P.AccountId = c.AccountId
INNER JOIN PlayerLevel L ON L.id = P.PlayerLevelId
WHERE C.TxnTime BETWEEN '2010-08-01 00:00:00.000' AND '2010-08-31 23:59:59.997'
AND L.LevelName = 'Pu'
GROUP BY
c.AccountId
,P.Operational
|