I have specific scenario to show list of count for each date. Below are query and what I tried.
I need datewise count for each day using below condition. (Count less then date)
SELECT COUNT(*)
FROM Queues (nolock)
WHERE InsDateTime < '2014-05-27'
Now, I need to use UNION if I need it for multiple days like below.
SELECT COUNT(*)
FROM Queues (nolock)
WHERE InsDateTime < '2014-05-27'
UNION
SELECT COUNT(*)
FROM Queues (nolock)
WHERE InsDateTime < '2014-05-26'
And So on..
I need count for each day dynamically with above condition.. I am confused from where to start. As of now I am using union for multiple days to get output.