Hi All,
I have a query that brings back a count of a field in a table grouped by Process_Date.
This brings back the right count but if for some reason nothings processed on a particular day of that month it doesn't bring back a data row for that day. What I would like is for the query to bring back a row per day of that month ... but I can't figure out how.
This is what I have so far:
This gives me 30 select statements ... how do I get it to bring me back a table with 30 rows instead??
Can you help?
Thanks
Julie
I have a query that brings back a count of a field in a table grouped by Process_Date.
This brings back the right count but if for some reason nothings processed on a particular day of that month it doesn't bring back a data row for that day. What I would like is for the query to bring back a row per day of that month ... but I can't figure out how.
This is what I have so far:
Code:
Declare @Start as datetime
Declare @End as datetime
Declare @dateCounter as datetime
Set @Start = '01/07/2007'
Set @End = '31/07/2007'
Set @dateCounter = @Start
while @dateCounter !> @End
begin
select Process_Date, count(tag20c_corp) from v_MT568_Outgoing_1
where Process_Date = @dateCounter
group by Process_Date
set @dateCounter = @dateCounter + 1
end
This gives me 30 select statements ... how do I get it to bring me back a table with 30 rows instead??
Can you help?
Thanks
Julie