Home All Groups Group Topic Archive Search About
Author
20 Jan 2006 3:19 PM
John
I have a recordset that consists of among other things a list of values and
dates  over the next 12 months, I want to display these dates in a table
ie

Jan Feb Mar Apr May Jun etc
12   80    120   5    65  56  etc

The months are on a 12 month rolling table, how would i achieve this,
perhaps using a case statement or ?

thanks in anticipation

John

Author
20 Jan 2006 3:51 PM
Jens
Yes, I would do that to. Due to the fact that there will be no more
month (names) in the future this should be an appropiate solution. If
the tables is VERY big and the values seldom change in that table and
the query time must be fast you should thing about (if they are
aggregatable) using AS for this. This could speed up your performance
and let you (with the help of a time dimension) give you the possibilty
to aggregate the values fast from different views.

HTH, jens Suessmeyer.
Author
20 Jan 2006 4:05 PM
John
Can you give me some pointers of how to acheive this please ?


Show quote
"Jens" <J***@sqlserver2005.de> wrote in message
news:1137772267.696338.62730@g49g2000cwa.googlegroups.com...
> Yes, I would do that to. Due to the fact that there will be no more
> month (names) in the future this should be an appropiate solution. If
> the tables is VERY big and the values seldom change in that table and
> the query time must be fast you should thing about (if they are
> aggregatable) using AS for this. This could speed up your performance
> and let you (with the help of a time dimension) give you the possibilty
> to aggregate the values fast from different views.
>
> HTH, jens Suessmeyer.
>
Author
21 Jan 2006 10:23 AM
Jens
Sure, do you need information for AS or the setbased solution ? For the
set based solution it would be interesting to get some DDL and sample
data from your database. http://www.aspfaq.com/5006, otherwise a
generic solution would be

SELECT
  CASE MONTH(DateColumn)
     WHEN 1 THEN SUM(SomeValue) END As January (...)

HTH, jens Suessmeyer.

AddThis Social Bookmark Button