Hi,
I have an to write an update query, based on dates, which I can't quite figure out. The details are:
Table A:
AccountID
DateFrom
DateTo
Value
Table B:
AccountID
DateFrom
DateTo
Value
What I need to do is update Table A Value with the Value from Table B where the AccountID's match and the DateTo in Table B is not later than that in Table A (i.e. there can be multiple records in B, so I want the latest for each account that's not later than that AccountID's entry in table A).
I think that makes sense!
Any help would be appreciated.
Cheers
I have an to write an update query, based on dates, which I can't quite figure out. The details are:
Table A:
AccountID
DateFrom
DateTo
Value
Table B:
AccountID
DateFrom
DateTo
Value
What I need to do is update Table A Value with the Value from Table B where the AccountID's match and the DateTo in Table B is not later than that in Table A (i.e. there can be multiple records in B, so I want the latest for each account that's not later than that AccountID's entry in table A).
I think that makes sense!
Any help would be appreciated.
Cheers