I have a table of data which gives prices for many stocks over many periods of time. It also records prices per exchange. I would like a query to give the exchanges as column headings, the dates as row heading and the no. of stocks prices in the middle. For example
1st Jan 4564,6879,2379
2nd Jan 6897,3519,1297
The list of exchanges is in a separate table to the list of prices, but there is a one to many relationship between the exchange table and the price table (there may be exchanges on the exchange table that are not on the price table, but not vice versa)
I'd also like to be able to choose how far back I want to go e.g only show how many stocks have priced in the last week.