Home Forums SQL Server 7,2000 T-SQL Summing charges based on the record level NRV code RE: Summing charges based on the record level NRV code

  • I also work in a hospital writing SQL reports from our vendor system. I don't claim to be a SQL Guru, but my SQL knowledge outweighs my medical background of only 3 months!

    The "group by" clause of the expression is the key in the example given. It will group the results on the fields listed in the "group by" clause and the "sum" expressions will be specific to those groups.

    I am assuming that when you used "sum" before and were getting a report wide total, you did not have a group by clause.

    I hope this helps clarify things a little.

    Good luck!