A
Arnaud Lesauvage
Hi group !
I have a problem with a crosstab query in Access 2000.
I want to pivot by month.
The table contains only data fromthe last 12 months (including the
current one), so there are only 12 values for Format([date_month],'mmmm
yyyy').
For the moment, is ranges from 'January 2006' to 'December 2006').
If I run the query with only PIVOT Format([date_month],'mmmm yyyy'), the
columns are in akphabetical order (april 2006, august 2006, ...).
I want them in chronological order of course, so I tried adding IN (...)
to the query, but if I run :
TRANSFORM Nz(Sum(l.total),0) AS [SommeDeTotal Annuel]
SELECT l.page, l.sortindex, Sum(l.total) AS [Total Annuel]
FROM log_analyse_croisee AS l
GROUP BY l.page, l.sortindex
PIVOT Format([date_month],'mmmm yyyy')
In (Format(DateAdd(m,-11,Now()) 'mmmm yyyy'),
Format(DateAdd('m',-10,Now()), 'mmmm yyyy'),
Format(DateAdd('m',-9,Now()), 'mmmm yyyy'),
Format(DateAdd('m',-8,Now()), 'mmmm yyyy'),
Format(DateAdd('m',-7,Now()), 'mmmm yyyy'),
Format(DateAdd('m',-6,Now()), 'mmmm yyyy'),
Format(DateAdd('m',-5,Now()), 'mmmm yyyy'),
Format(DateAdd('m',-4,Now()), 'mmmm yyyy'),
Format(DateAdd('m',-3,Now()), 'mmmm yyyy'),
Format(DateAdd('m',-2,Now()), 'mmmm yyyy'),
Format(DateAdd('m',-1,Now()), 'mmmm yyyy'), Format(Now(), 'mmmm yyyy'))
I have an error :
), [ or element absent in expression 'Format([date_month],'mmmm yyyy')
In (Format(DateAdd(m,-11,Now()'
What is the problem here ?
Thanks for your help !
I have a problem with a crosstab query in Access 2000.
I want to pivot by month.
The table contains only data fromthe last 12 months (including the
current one), so there are only 12 values for Format([date_month],'mmmm
yyyy').
For the moment, is ranges from 'January 2006' to 'December 2006').
If I run the query with only PIVOT Format([date_month],'mmmm yyyy'), the
columns are in akphabetical order (april 2006, august 2006, ...).
I want them in chronological order of course, so I tried adding IN (...)
to the query, but if I run :
TRANSFORM Nz(Sum(l.total),0) AS [SommeDeTotal Annuel]
SELECT l.page, l.sortindex, Sum(l.total) AS [Total Annuel]
FROM log_analyse_croisee AS l
GROUP BY l.page, l.sortindex
PIVOT Format([date_month],'mmmm yyyy')
In (Format(DateAdd(m,-11,Now()) 'mmmm yyyy'),
Format(DateAdd('m',-10,Now()), 'mmmm yyyy'),
Format(DateAdd('m',-9,Now()), 'mmmm yyyy'),
Format(DateAdd('m',-8,Now()), 'mmmm yyyy'),
Format(DateAdd('m',-7,Now()), 'mmmm yyyy'),
Format(DateAdd('m',-6,Now()), 'mmmm yyyy'),
Format(DateAdd('m',-5,Now()), 'mmmm yyyy'),
Format(DateAdd('m',-4,Now()), 'mmmm yyyy'),
Format(DateAdd('m',-3,Now()), 'mmmm yyyy'),
Format(DateAdd('m',-2,Now()), 'mmmm yyyy'),
Format(DateAdd('m',-1,Now()), 'mmmm yyyy'), Format(Now(), 'mmmm yyyy'))
I have an error :
), [ or element absent in expression 'Format([date_month],'mmmm yyyy')
In (Format(DateAdd(m,-11,Now()'
What is the problem here ?
Thanks for your help !