SELECT Customer, Product, ; SUM(IIF( movimento <= 50, Quantidade, 0)) - ; SUM(IIF( movimento >= 51, Quantidade, 0)) AS Balance, ; from ficmvmp ; group by 1,2 ; ORDER BY 1,2 ; INTO CURSOR crsReporty>Hi Sergey,
>Customer (9999) movimento(05) Quantidade(100) Product(IS0001)..in >Customer (9999) movimento(55) Quantidade(050) Product(IS0001)..out >Customer (9999) movimento(05) Quantidade(250) Product(IS1000)..in >Customer (1000) movimento(05) Quantidade(150) Product(IS0001)..in >>
>Customer 9999 >Product Stock >IS0001 50 >IS1000 250 > >Customer 1000 >Product Stock >IS1000 150 >>