automaticly moving columns in a query result

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
 
G

Guest

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.
 
J

John Vinson

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]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top