Click here to Skip to main content
15,881,204 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i hope this time you can understand me
------------------------------------------------------------------------

MY SQL

SQL
   SELECT TOP 2 AFStubID ,ORNoFrom,ORNoTo,Qty,Trancode   FROM dtaAFRegisterMst					
    WHERE AFStubID IN (SELECT AFStubID FROM dtaAFRegisterTrn WHERE RepID = ' ' AND AFName = 'AF51')	


Output of the SQL Above
>
> STUBID SampleORFrom SampleORTO QuantityUsed RemainingQuantity
> AF1000003 1 50 50 0
> AF1000004 51 100 50 0



> And I would like to to like this and i dont have any idea to do it

> STUBID SampleORFrom SampleORTO QuantityUsed RemainingQuantity
> AF1000003 21 50 30 20
> AF1000004 61 100 40 10


please help me thanks
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900