I have the query below:
SELECT
Sender,
DATEADD(dd, DATEDIFF(dd, 0, Date_Reported) / 7 * 7, 0) AS Weekdate,
COUNT(status) AS TranCount
FROM
tx
WHERE
customer = 'ABC'
AND DATEADD(dd, DATEDIFF(dd, 0, Date_Reported) / 7 * 7, 0) >= DATEADD(dd, DATEDIFF(dd, 0, GETDATE()) / 7 * 7, 0)
AND DATEADD(dd, DATEDIFF(dd, 0, Date_Reported) / 7 * 7, 0) < DATEADD(dd, DATEDIFF(dd, 0, GETDATE()), 0)
GROUP BY
Sender, DATEADD(dd,DATEDIFF(dd,0,Date_Reported)/7 * 7,0)
This returns a list of all transactions for each sender. What I want is only 2 rows of two sender types- one that is sender = "AA"
and the other sender NOT IN "AA"
.
How do I incorporate this into my script? At the moment I get a list of 50 senders, but I just want 2 as stated above
Expected Result
Sender | Weekdate | TranCount
AA | 25/06/2018 | 33
"Not Sender AA" | 25/06/2018 | 26