Wednesday, 15 May 2013

sql - Missing Operator syntax error in Access crosstab query -



sql - Missing Operator syntax error in Access crosstab query -

i'm having problem figuring out query missing:

parameters startdate datetime; select count(grants.[grant identified]) [countofgrant identified] grants grants.[grant identified]=yes , (grants.[identified date] >= startdate) pivot ((year(grants.[identified date])*12 + format(grants.[identified date], "mm")) - (year(startdate)*12 + format(startdate, "mm")) + 1) in (1,2,3,4,5,6,7,8,9,10,11,12);

my mind has become numb looking @ , i've run through solutions find (which ’ != ' issue).

thanks.

the pivot clause tells trying crosstab query, don't have transform clause. general form of crosstab query in access sql is

transform aggregatefunction(valuefield) whatever select rowheadingfields tablename grouping rowheadingfields pivot columnheadingfield [in (valuelist)]

so query needs more this:

parameters startdate datetime; transform count(grants.[grant identified]) [countofgrant identified] select grants.[grant identified] grants grants.[grant identified]=yes , (grants.[identified date] >= startdate) grouping grants.[grant identified] pivot ((year(grants.[identified date])*12 + format(grants.[identified date], "mm")) - (year(startdate)*12 + format(startdate, "mm")) + 1) in (1,2,3,4,5,6,7,8,9,10,11,12);

sql ms-access

No comments:

Post a Comment