R
rudwan
hi
i have this tow queries :
SELECT countofProductID,sumofaccrudamnt
FROM FileOfTransferDistributed as Query1
SELECT code , Actual
FROM FileOfTransferDistributed as query2
then i wld like to join it all as :
SELECT Code, Actual
FROM query2
UNION SELECT countofProductID,sumofaccrudamnt
FROM Query1
until here is ok
now , there is one a specific amount Amt , must be join
also to this union query , but by provision ,
if query1.sumofaccrudamnt>0 then , add amt to it
otherwise , add it to query2.actual
how i could do it
i have this tow queries :
SELECT countofProductID,sumofaccrudamnt
FROM FileOfTransferDistributed as Query1
SELECT code , Actual
FROM FileOfTransferDistributed as query2
then i wld like to join it all as :
SELECT Code, Actual
FROM query2
UNION SELECT countofProductID,sumofaccrudamnt
FROM Query1
until here is ok
now , there is one a specific amount Amt , must be join
also to this union query , but by provision ,
if query1.sumofaccrudamnt>0 then , add amt to it
otherwise , add it to query2.actual
how i could do it