Hi all !
I'm desperately in need for some help on that one...
I have two tables, say A and B. B is linked to A with a foreign key NUM_A. B contains a series of business actions on A, each one having a close date. A contains an open date and a close date. Now comes the interesting bit :
I would like to update A.close_date with :
- The last B.close_date if it exists.
- A.open_date otherwise.
I've tried quite a lot of things by now, but am really new to SQL Server and am loosing a lot of time there.
Hope somebody can help !
Cheers,
I'm desperately in need for some help on that one...
I have two tables, say A and B. B is linked to A with a foreign key NUM_A. B contains a series of business actions on A, each one having a close date. A contains an open date and a close date. Now comes the interesting bit :
I would like to update A.close_date with :
- The last B.close_date if it exists.
- A.open_date otherwise.
I've tried quite a lot of things by now, but am really new to SQL Server and am loosing a lot of time there.
Hope somebody can help !
Cheers,