• would something like the following help?

    SUM(CASE WHEN col1> 0 THEN col1 ELSE 0 END) AS DEBIT,

    SUM(CASE WHEN col1< 0 THEN col1 ELSE 0 END) AS CREDIT

    If not, please post table def and sample data of the underlying table in a ready to use format as described in the first link in my signature together with your expected result.



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]