Andy, Try:
YEAR(dateadd(year,-1,tabInvoices.InvoiceDate) -mk -----Original Message----- From: Andy Ousterhout [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 30, 2004 11:37 AM To: CF-Talk Subject: SQL Question In MS SQL, why does this work: CASE YEAR(tabInvoices.InvoiceDate) but this throw and error that InvoiceDate is not in group: CASE YEAR(tabInvoices.InvoiceDate) -1 I can't add InvoiceDate to GROUP BY because then the results are wrong.... Andy ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net http://www.cfhosting.net Message: http://www.houseoffusion.com/lists.cfm/link=i:4:185705 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54