automaticly moving columns in a query result

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

columns in my query represent months of the year. I need for the first
column to be the current month followed by the next 11 months. As current
month changes then so does the order of the columns. Can I do that??

currently nov dec jan feb mar ap may jun jul aug sept oct

next month dec jan feb mar ap may jun jul aug sept oct nov
 
You could use the MonthName and Month function.
1st column of query = MonthName(Month(Date())), 2nd column =
MonthName((Month(Date())+1)), 3rd = MonthName((Month(Date())+2)), so on and
so forth
There is bound to be a more elegant way to do this in VBA, but that should
work as an interim solution.

Hope it helps,
Regards,
Nick.
 
columns in my query represent months of the year. I need for the first
column to be the current month followed by the next 11 months. As current
month changes then so does the order of the columns. Can I do that??

currently nov dec jan feb mar ap may jun jul aug sept oct

next month dec jan feb mar ap may jun jul aug sept oct nov

Is this a Crosstab query? Is your table properly normalized? Please
post the current SQL.

I suspect you'll need to actually generate the SQL code in VBA in
order to do this but it's hard to be sure.

John W. Vinson[MVP]
 
Back
Top