SELECT STOKID,SKODU, ADI, STOKISL.DEPOID,DEPO.DEPOADI , SUM(CASE WHEN GCADET > 0 THEN GCADET ELSE 0 END) AS GADET,   SUM(CASE WHEN GCADET < 0 THEN -1*GCADET ELSE 0 END) AS CADET,   SUM(GCADET) AS BAKIYE,ISNULL(MAX(SALISFIYAT),0) * SUM(GCADET) AS KALANTUTAR  FROM  dbo.STOKISL,DEPO  WHERE STOKISL.DEPOID=DEPO.DEPOID GROUP BY STOKID,SKODU,ADI,STOKISL.DEPOID,DEPO.DEPOADI 
Elektra
                                                                                      Tarih       : [BUGUN   ]
                                                                                      Saat        :   [BUSAAT]
                                                                                      Alındığı T. : [GTARIH  ]

                                  S T O K   D E Ğ E R   B A K İ Y E    L İ S T E S İ  

  STOKID     SKODU      ADI                                       GADET     CADET     BAKIYE     KALANTUTAR    
  ---------- ---------- ----------------------------------------- --------- --------- ---------- --------------
{ [STOKID:N] [SKODU   ] [ADI                                    ] [>GADET ] [>CADET ] [>BAKIYE ] [~2KALANTUTAR]}[DEPOID:N] [DEPOADI    ] 
