Update Query

  • Thread starter Thread starter Maqza via AccessMonster.com
  • Start date Start date
M

Maqza via AccessMonster.com

Hi!
I have one query like this
Cust_no daily_price dateof price
10 5000 28/09/2006
20 6000 28/09/2006
30 500 28/09/2006
40 4500 28/09/2006
50 5500 28/09/2006


Cust_no daily_price dateof price
10 29/09/2006
20 6000 29/09/2006
30 4500 29/09/2006
40 29/09/2006
50 5500 29/09/2006


Cust_no daily_price dateof price
10 5000 30/09/2006
20 30/09/2006
30 4500 30/09/2006
40 4500 30/09/2006
50 30/09/2006


I want to update previous daily_price like on 29/09/2006 I want to update
28/09/2006 price where 29/09/2006 daily_price is null
Same like on 30/09/2006 to update 29/09/2006 prices
Where 30/09/2006 daily_price is null

Please help me in this record
Thanks
 
If I have understood this right I would have one query that identified
records with a daily price as Null.

I would have a second query that joined the keys of those records to the
original table, and found the keys of the records with a price and the
maximum date.less than the date of the one with null price.

Then I would write the update query with those queries joined as inputs
which would update all records with null dates with the prices of the latest
prior record.

I hope this helps more than it confuses.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top