I have data like the following in an Access 2007 db.Customer Date Year SaleX Corp 01/05/07 2007 $10,000X Corp 03/03/08 2008 $20,000Y Corp 04/18/08 2008 $10,000Y Corp 07/11/09 2009 $25,000Y Corp 08/20/09 2009 $30,000Z Corp 02/02/09 2009 $40,000Z Corp 06/23/09 2009 $50,000
I need to create a report in Excel 2007 showing customers that are new this year. In other words, I need to find customers that had sales in 2009 but not in 2008 or earlier. For this data, the result would be Z Corp, and the total of $90,000.I think sql is probably the best way to do this, but I'm having a hard time figuring out what kind of query I need to create. Conceptually, I think the following is what I want (almost), but how do I express this in sql?select Customer, Sum of Salewhere sum of Sale for year 2008 = 0 and sum of Sale for year 2009 > 0