SQL return zeros
-
SELECT Sum(Amount) as "Total Expenditures", Month(eDate) as "Month" FROM Expenditure GROUP BY Month(eDate) ORDER BY Month(eDate) Above is my current SQL statement. I would like to change it so that it would generate a table that shows zeros for months that have zero "Total Expenditures". Currently it only shows amounts for months that have total > 0. I think I could do it once I get it into my datatable but the query would be nicer. Thanks "It has become appallingly obvious that our technology has exceeded our humanity." - Albert Einstein (1879-1955) "I think there is a world market for maybe five computers." - Thomas Watson (1874-1956), Chairman of IBM, 1943 "640K ought to be enough for anybody." - Bill Gates (1955-), in 1981 "Half this game is ninety percent mental." - Yogi Berra
-
SELECT Sum(Amount) as "Total Expenditures", Month(eDate) as "Month" FROM Expenditure GROUP BY Month(eDate) ORDER BY Month(eDate) Above is my current SQL statement. I would like to change it so that it would generate a table that shows zeros for months that have zero "Total Expenditures". Currently it only shows amounts for months that have total > 0. I think I could do it once I get it into my datatable but the query would be nicer. Thanks "It has become appallingly obvious that our technology has exceeded our humanity." - Albert Einstein (1879-1955) "I think there is a world market for maybe five computers." - Thomas Watson (1874-1956), Chairman of IBM, 1943 "640K ought to be enough for anybody." - Bill Gates (1955-), in 1981 "Half this game is ninety percent mental." - Yogi Berra
:confused:How about a WHERE clause like 'WHERE Sum(things) = 0' at the end. The warlord
-
:confused:How about a WHERE clause like 'WHERE Sum(things) = 0' at the end. The warlord