• Wow a whole 43 minutes and a second between bumping the thread. Please remember we are all unpaid volunteers here and post within our spare time, so please be patient and someone will eventually answer your question.

    Based on what I believe the interpretation to be you want something like the following.

    ;with cte as

    (

    select

    case

    when total < 100 then '< 100'

    when total >= 100 and total < 1000 then '>= 100 and < 1000'

    when total >= 1000 and total < 10000 then '>= 1000 and < 10000'

    when total >= 10000 then '>= 10000'

    end as value,

    total

    from

    Acct_sum

    )

    select

    value,

    COUNT(value) as NumberOfAccounts,

    SUM(total) as Total

    from

    cte

    group by

    value