I have a single large SQL Table and I have the following query with returns some basic info:
SELECT
CustomerID AS "Customer Name"
,COUNT(ID) AS "Total Emails"
FROM EmailDatas WHERE Expired = 0
GROUP BY CustomerID
Result
Customer Name Total Emails
A 1000
B 9200
C 11400
What I am trying to do is get a count of emails for todays date returned in the same query, something like:
Result
Customer Name Total Emails Emails Today
A 1000 34
B 9200 7
C 11400 54
I can amend the original query to return the info:
SELECT
CustomerID AS "Customer Name"
,COUNT(ID) AS "Total Emails"
FROM EmailDatas WHERE Expired = 0 and starttime > getdate()
GROUP BY CustomerID
What I need is basically to have these 2 queries combined.
Hope this makes sense.
Thanks!
starttimehere???