Crosstab Query for Report with Variable Dates

Malcolm17

Member
Local time
Today, 08:02
Joined
Jun 11, 2018
Messages
129
Hi,

I have a database which I am looking to use a crosstab query which will populate the data for a report. The report data (column headings) will be products and dates which the user can select from a form, so the column headings will change depending upon the date range selected (max 7). I have uploaded an example with sample data I have used fixed dates (not from the form) for this example, however my issues is that I cannot work out how to get the query to change the date column headings (which could be any date) to pull through to my report on fixed headings if this is how it would be done.

I'm sure I have achieved this a few years ago, however cannot remember or see how to do this now.

Many thanks in advance for your help!!

Malcolm
 

Attachments

Hi. You can either use VBA to dynamically adjust your report headings, or you can use a "staging" query to predefine the columns for your crosstab query. Just a thought...
 
Hi theDBguy,

I think I may have done it with a staging query before. Do you have any example of how I would do this using VBA please?
 
Hi, I cannot find your example using the download link on your link, I'm assuming that it is somewhere on the Microsoft website?
 
Hi, I cannot find your example using the download link on your link, I'm assuming that it is somewhere on the Microsoft website?
Sorry about that. Let me check...
 

Users who are viewing this thread

Back
Top Bottom