Hi,
I have a query (below) that displays all the dates of a given month and a count of messages inserted into a table on each day of that month ie.
Date Count
--------------------
1/07/2007 0
2/07/2007 0
3/07/2007 5
4/07/2007 10
5/07/2007 0
However is there a way I can flip it round so the headings are the dates and then the count is the detail eg
1/07/2007 2/07/2007 3/07/2007 4/07/2007 5/07/2007
-------------------------------------------------------
0 0 5 10 0
I need to display the query in the above form in an Access report?
Any help would be great ...
Here's the query
Thanks
Julie
I have a query (below) that displays all the dates of a given month and a count of messages inserted into a table on each day of that month ie.
Date Count
--------------------
1/07/2007 0
2/07/2007 0
3/07/2007 5
4/07/2007 10
5/07/2007 0
However is there a way I can flip it round so the headings are the dates and then the count is the detail eg
1/07/2007 2/07/2007 3/07/2007 4/07/2007 5/07/2007
-------------------------------------------------------
0 0 5 10 0
I need to display the query in the above form in an Access report?
Any help would be great ...
Here's the query
Code:
Declare @Start as datetime
Declare @End as datetime
Set @Start = '01/07/2007'
Set @End = '31/07/2007'
declare @Start_loop datetime
create table #DateTable (Dates datetime)
set @Start_loop = @Start
while @Start_loop <= @End
begin
insert into #DateTable values(@Start_loop)
set @Start_loop = @Start_loop + 1
end
select dates, count(process_time) from #DateTable d
left join pre..all_mess_inc
on dates = Process_date
-- where Process_date between @Start and @End
Group by dates
Thanks
Julie