Login
`
Templates, Tools and Utilities
|
||
![]() |
![]() |
Icetips Article
Back to article list
Search Articles
Add Comment
Printer friendly
Direct link
SQL Related Articles: Select with SUM 2002-12-04 -- Ray Goudie Newsgroups: comp.lang.clarion
How about using the following:
---
SELECT CmpID, sum(case when Amt > 0 then Amt end) AS Debits,
sum(case when Amt < 0 then Amt end) AS Credits,
sum(case when Amt = 0 then Amt end) AS ZeroAmts
FROM GLFINAN
GROUP BY CmpID
---
-Ray.
"Ben Kim (Vertical Dimensions, Inc.)"
Today is March 31, 2025, 11:37 am This article has been viewed 35314 times. Google search has resulted in 21 hits on this article since January 25, 2004.
|
|