View Full Version : Selecting all columns after a specific number of columns from a cross tab query


accessaspire219
07-06-2009, 01:31 PM
Hi,
I have a cross tab query that is based on monthly data. I have another select query based off of the crosstab query. At the end of each month the crosstab query gets a new column with the data for that month. The crosstab query also has details such as name, type etc in addition to the monthly data. I need to write SQL such that it will always ignore the initital 4 columns and select ALL columns after the 4 initials columns.

Does anyone know how this can be done?

Appreciate your help,
Thanks!

Endre
07-20-2009, 01:46 AM
See my reply in the following thread:

http://www.access-programmers.co.uk/forums/showthread.php?t=176256

Hope this helps...

DCrake
07-20-2009, 02:10 AM
Just tried something, maybe it will work for you, I don't know. But if you create a copy of the existing crosstab query but set your 4 row headings to not shown the grouping will still be achieved but the columns are hidden. So your other query will not need to worry about the first 4 columns it will simply select all columns in the crosstab query.

Try it.

David

accessaspire219
07-20-2009, 01:49 PM
Thanks David and Endre. I will try it out and let you know if it works!