Subject | Another CTE question |
---|---|
Author | Lester Caine |
Post date | 2011-09-05T08:57:45Z |
I've got some legacy code that creates a temporary table of data which can then
be used to create a report, but I am quite sure that this can now be replaced
with a single CTE approach, and while I've got some quite nice multi layer
reports, one thing is still alluding me ... 2D grid ...
I now need to create a grid which has date down the report, and time slots
across. I've got the base report with date and timeslot down the result set, but
I'm trying to work out the tidiest way of 'twisting' the timeslot data to
provide a single row on the resulting output?
Do I end up with a list of fields each picking up one timeslot for a particular
date? Or is there some way to use the 'timeslot' table that I used to use in the
old two phase process?
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php
be used to create a report, but I am quite sure that this can now be replaced
with a single CTE approach, and while I've got some quite nice multi layer
reports, one thing is still alluding me ... 2D grid ...
I now need to create a grid which has date down the report, and time slots
across. I've got the base report with date and timeslot down the result set, but
I'm trying to work out the tidiest way of 'twisting' the timeslot data to
provide a single row on the resulting output?
Do I end up with a list of fields each picking up one timeslot for a particular
date? Or is there some way to use the 'timeslot' table that I used to use in the
old two phase process?
--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php