i have a problem to create query for table
mouventDeStock
|| idMv || dateMv ||qteMv || typeMV(bit) || codeMv ||
the feild type is either 0 or 1 if 0 means out of the stock , if 1 means means input of stock
i wanna calculate the qte witch is equal to
qte = ( sum(qteMv) where typeMv = 1 ) - ( sum(qteMv) where typeMv = 0 )
how i can't do it in sql
(select sum(mvQte) from mouvementDeStock
where (mvType = 1 and mvCode = 'ART_18'))
-
(select sum(mvQte) from mouvementDeStock
where (mvType = 0 and mvCode = 'ART_18')
but it's not working at all