From: Bayless K. <bk...@co...> - 2015-11-19 20:09:47
|
The following query fails. Select DONORS.COMPANY As Company, Sum(DONATIONS.FOOD) As Food, Sum(DONATIONS.CHECKS) As Check, Sum(DONATIONS.CASH) As Cash, Sum(DONATIONS.MISC) As Misc, Sum(DONATIONS.LABOR) As Labor, Sum(DONATIONS.TOTALS) As Totals, Year(DONATIONS.DONATIONDATE) As TheYear >From DONORS Left Join DONATIONS On DONORS.ID = DONATIONS.DONORID Where Totals >= 100.00 And TheYear = 2014 Group By TheYear, DONORS.COMPANY, DONATIONS.DONATIONDATE Order By DONORS.COMPANY The message is user lacks privilege or object not found: THEYEAR / Error Code: –5501 / State: 42501 The offending part seems to be TheYear in the Where clause. If I remove that, it works but not what I need, of course. I also tried substituting Year(donations.donationdate) with the same result. It seems that I cannot use a function or the result of a function in the Where clause. Is this correct or am I committing some other error? All the columns do exist. I am using HSQL 2.3.3. Thanks, Bayless |