mySQL Left Join on multiple tables with conditions
I have a problem. I have 4 tables: Invoice_Payment, Invoice, Client, and Calendar Basically, I have the below query, which works well, except, months with no date_due don't return. I.E only months with a date_due will be returned. Note: the calendar table simply lists every day of the year. It contains a single col call date_field Database: http://oberto.co.nz/jInvoice.txt Expected output: my current query, below, will return something like: month total August 5 September 0 October 196 November 205 December 214 January 229 Notice how September isn't returned? It's because table Invoice_Payment