want sql query for this senario : tbl_employee
empid empname openingbal 
2     jhon    400    
3     smith   500    

tbl_transection1
tid  empid  amount  creditdebit date
1    2      100     1           2016-01-06 00:00:00.000
2    2      200     1           2016-01-08 00:00:00.000
3    2      100     2           2016-01-11 00:00:00.000
4    2      700     1           2016-01-15 00:00:00.000
5    3      100     1           2016-02-03 00:00:00.000
6    3      200     2           2016-02-06 00:00:00.000
7    3      400     1           2016-02-07 00:00:00.000


tbl_transection2
tid  empid  amount  creditdebit date
1    2      100     1           2016-01-07 00:00:00.000
2    2      200     1           2016-01-08 00:00:00.000
3    2      100     2           2016-01-09 00:00:00.000
4    2      700     1           2016-01-14 00:00:00.000
5    3      100     1           2016-02-04 00:00:00.000
6    3      200     2           2016-02-05 00:00:00.000
7    3      400     1           2016-02-08 00:00:00.000


here 1 stand for credit and 2 for debit


i want oput put like

empid  empname   details            debitamount   creditamount   balance     Dr/Cr    date
2      jhon      opening Bal                                    400          Cr      
2      jhon      transection 1                    100           500          Cr      2016-01-06 00:00:00.000
2      jhon      transection 2                    100           600          Cr      2016-01-07 00:00:00.000
2      jhon      transection 1                    200           800          Cr      2016-01-08 00:00:00.000
2      jhon      transection 2                    200           1000         Cr      2016-01-08 00:00:00.000
2      jhon      transection 2        100                       900          Dr      2016-01-09 00:00:00.000
2      jhon      transection 1        100                       800          Dr      2016-01-11 00:00:00.000
2      jhon      transection 2                    700           1500         Cr      2016-01-14 00:00:00.000
2      jhon      transection 1                    700           2200         Cr      2016-01-15 00:00:00.000
3      smith     opening Bal                                    500          Cr      
3      smith     transection 1                    100           600          Cr      2016-02-03 00:00:00.000
3      smith     transection 2                    100           700          Cr      2016-02-04 00:00:00.000
3      smith     transection 2        200                       500          Dr      2016-02-05 00:00:00.000
3      smith     transection 1        200                       300          Dr      2016-02-06 00:00:00.000
3      smith     transection 1                    400           700          Cr      2016-02-07 00:00:00.000
3      smith     transection 2                    400           1100         Cr      2016-02-08 00:00:00.000




