2

I use this query to get a value for a range of months. For example, January 1.10, February 2.37.

"SELECT SUM(DISTRIBUTED_AMOUNT / EXCHANGE_RATE)
FROM royalties
WHERE DATE BETWEEN '".$datemin."' AND '".$datemax."'
GROUP BY DATE 
ORDER BY DATE ASC"

Is there a way to return a value of 0 if there are no rows within a certain month?

Michael St Clair
  • 5,937
  • 10
  • 49
  • 75

0 Answers0