I want my SQL query can run like this.

I have two tables:
- Key1, Date, In
- key2, Date, Out
Until now I achieved this with a UNION:
select Date , In , '' as 'out'
from table1
Union ALL
select Date, '' as In, Out
from table2
How about the balance ?
Please help me
At the present time, the fastest and practically only, way to calculate running totals in SQL Server is to use a cursor.