• Sorry, that's the problem with not having sample data to test with...

    you probable want something more like this:

    select point_range,count(*)

    from (

    select

    jp.userid

    , case

    when sum(jp.points) between 0 and 1 then '0-1'

    when sum(jp.points) between 1 and 2 then '1-2'

    when sum(jp.points) between 2 and 50 then '2-50'

    when sum(jp.points) between 51 and 100 then '51-100'

    when sum(jp.points) between 101 and 300 then '101-300'

    when sum(jp.points) between 301 and 1000 then '301-1000'

    when sum(jp.points) between 1001 and 1500 then '1001-1500'

    when sum(jp.points) between 1501 and 2000 then '1501-2000'

    when sum(jp.points) between 2001 and 3000 then '2001-3000'

    when sum(jp.points) between 3001 and 4000 then '3001-4000'

    when sum(jp.points) between 4001 and 5000 then '4001-5000'

    when sum(jp.points) between 5001 and 6000 then '5001-6000'

    when sum(jp.points) between 6001 and 7000 then '6001-7000'

    when sum(jp.points) between 7001 and 8000 then '7001-8000'

    when sum(jp.points) between 8001 and 9000 then '8001-9000'

    when sum(jp.points) between 9001 and 10000 then '9001-10000'

    when sum(jp.points) > 10000 then '10000-above'

    end as point_range

    from StatusLevelPnt jp

    inner join user ju on jp.userid = ju.userid

    group by jp.userid

    ) as grouped

    group by point_range

    MM



    select geometry::STGeomFromWKB(0x0106000000020000000103000000010000000B0000001000000000000840000000000000003DD8CCCCCCCCCC0840000000000000003DD8CCCCCCCCCC08408014AE47E17AFC3F040000000000104000CDCCCCCCCCEC3F9C999999999913408014AE47E17AFC3F9C99999999991340000000000000003D0000000000001440000000000000003D000000000000144000000000000000400400000000001040000000000000F03F100000000000084000000000000000401000000000000840000000000000003D0103000000010000000B000000000000000000143D000000000000003D009E99999999B93F000000000000003D009E99999999B93F8014AE47E17AFC3F400000000000F03F00CDCCCCCCCCEC3FA06666666666FE3F8014AE47E17AFC3FA06666666666FE3F000000000000003D1800000000000040000000000000003D18000000000000400000000000000040400000000000F03F000000000000F03F000000000000143D0000000000000040000000000000143D000000000000003D, 0);

  • Forum Etiquette: How to post Reporting Services problems
  • [/url]
  • Forum Etiquette: How to post data/code on a forum to get the best help - by Jeff Moden
  • [/url]
  • How to Post Performance Problems - by Gail Shaw
  • [/url]