Hi,
I have a database table as follows:
Product Date Price
------- ---- -----
productA 07/05/05 100
productB 07/08/05 54
productB 07/10/05 51
productA 07/14/05 97
productB 07/16/05 49
productA 07/19/05 97
productB 07/22/05 52
productB 07/25/05 54
productA 07/30/05 101
productB 08/03/05 52
productA 08/08/05 103
productB 08/12/05 54
productA 08/18/05 103
productB 08/25/05 52
I want to find out (through a SQL query) all the dates where the price of a product 'starts' to increase after having fallen or remaining static.
for e.g. price of productA decreased from 07/05 to 07/14 (it remained same on 07/19) then it picked up on 07/30/05 - therefore my query would pick up the row:
productA 07/30/05 101
similarly, it would pick up:
productB 07/2205 52
and
productB 08/12/05 54
How do I accomplish this - this is a tough query for me. I can use either T-SQL or Jet-SQL to accomplish this.
My guess is that I may have to use temporary tables to accomplish this - but if you can think of a query that doesn't use temp tables - that's fine too. so far - i have used temporary tables but can't nail this one.
Thanks.