I have a MS Access 2000 table with approx 300,000 records. I need help with constructing a query.
I have all this information in a single table.
The table has, among others, these fields.
Item : Price: First sold date : Last sold date
Beef $1.99 28/12/2010 31/12/2010
Beef $1.89 27/12/2010 30/12/2010
Beef $1.79 27/12/2010 29/12/2010
(maybe many more records with same item at different prices & dates)
Milk $0.59 28/11/2010 28/11/2010
Milk $0.55 27/11/2010 28/11/2010
(maybe many more records with same item at different prices & dates)
(many more records with different items sold at various prices/dates)
As time (sold dates) passes one would expect that the price would increase, but the trend is not constantly down - also on the same day things can have been sold at different prices.
Using the 'beef' @ $1.99 above as an example. On 28/12/10 it was sold at $1.99, but on the 29th it went down to $1.79 and then on 30th it was sold at $1.89 before finally settling back at $1.99 on the 31st.
I want is a query to give me this:
Item : Price : later sold at
Beef : $1.99 : $1.79, $1.89
Beef : $1.89 : $1.79
Beef : $1.79 : none
Milk : $0.59 : $0.55
I'm not overly impressed with Access 2000 so far, nor am I at all familiar with it. But the main problem is constructing this query, I just can't get my head around how to do it.
Which list can be arbitrarily long?
Not easily done in Access as a single query. Doable with MySQLs group_concat, or the XML (yes, really) functions in Oracle or MSSQL, but not really useful to do: what do you do with an arbitrary length list? (I presume you want to graph it? But why not just graph date over price by item?)
posted by orthogonality at 11:12 AM on February 13, 2011