SELECT TOP (100) PERCENT dbo.TBLSTSABIT.STOK_KODU, dbo.TBLSTSABIT.STOK_ADI, dbo.TBLSTHAR.STHAR_TARIH AS TARIH, dbo.TBLSTHAR.STHAR_NF AS NET_FIAT, dbo.TBLSTHAR.STHAR_ACIKLAMA AS CARI_KOD, dbo.TBLSTHAR.STHAR_GCKOD AS GCKOD, dbo.TBLSTHAR.STHAR_KDV AS KDV, dbo.TBLSTHAR.STHAR_HTUR AS HTUR, (CASE WHEN TBLSTHAR.STHAR_GCKOD = 'C' AND TBLSTHAR.STHAR_HTUR IN ('I', 'J', 'K') THEN STHAR_GCMIK ELSE 0 END) AS SATIS_MIKTARI, (CASE WHEN TBLSTHAR.STHAR_GCKOD = 'C' AND TBLSTHAR.STHAR_HTUR IN ('I', 'J', 'K') THEN STHAR_GCMIK * STHAR_NF ELSE 0 END) AS SATIS_TUTARI, (CASE WHEN TBLSTHAR.STHAR_GCKOD = 'G' AND TBLSTHAR.STHAR_HTUR IN ('I', 'J', 'K') THEN STHAR_GCMIK ELSE 0 END) AS ALIS_MIKTARI, (CASE WHEN TBLSTHAR.STHAR_GCKOD = 'G' AND TBLSTHAR.STHAR_HTUR IN ('I', 'J', 'K') THEN STHAR_GCMIK * STHAR_NF ELSE 0 END) AS ALIS_TUTARI, (CASE WHEN TBLSTHAR.STHAR_GCKOD = 'C' AND TBLSTHAR.STHAR_HTUR IN ('L', 'M') THEN STHAR_GCMIK ELSE 0 END) AS ALISTAN_IADE_MIKTARI, (CASE WHEN TBLSTHAR.STHAR_GCKOD = 'C' AND TBLSTHAR.STHAR_HTUR IN ('L', 'M') THEN STHAR_GCMIK * STHAR_NF ELSE 0 END) AS ALISTAN_IADE_TUTARI, (CASE WHEN TBLSTHAR.STHAR_GCKOD = 'G' AND TBLSTHAR.STHAR_HTUR IN ('L', 'M') THEN STHAR_GCMIK ELSE 0 END) AS SATISTAN_IADE_MIKTARI, (CASE WHEN TBLSTHAR.STHAR_GCKOD = 'G' AND TBLSTHAR.STHAR_HTUR IN ('L', 'M') THEN STHAR_GCMIK * STHAR_NF ELSE 0 END) AS IADE_TUTARI, dbo.TBLSTSABIT.GRUP_KODU, dbo.TBLSTSABIT.KOD_1 AS KOD1, dbo.TBLSTSABIT.KOD_2 AS KOD2, dbo.TBLSTSABIT.KOD_3 AS KOD3, dbo.TBLSTSABIT.KOD_4 AS KOD4, dbo.TBLSTSABIT.KOD_5 AS KOD5, dbo.TBLSTSABIT.ALIS_FIAT1, dbo.TBLCASABIT.CARI_ISIM, dbo.TBLSTHAR.PLASIYER_KODU AS PLS, DATEPART(MONTH, dbo.TBLSTHAR.STHAR_TARIH) AS AY, dbo.TBLSTHAR.STHAR_KOD2, dbo.TBLSTHAR.STHAR_BGTIP, dbo.TBLCASABIT.CARI_ILCE AS ILCE, dbo.TBLCASABIT.CARI_IL AS IL, dbo.TBLCASABIT.RAPOR_KODU1 AS RUT, dbo.TBLCASABIT.CARI_ADRES AS ADRES, dbo.TBLCASABIT.VERGI_DAIRESI AS V_DAIRESI, dbo.TBLCASABIT.VERGI_NUMARASI AS V_NO, dbo.TBLCASABIT.CARI_TEL AS TEL_NO, dbo.TBLCASABIT.CARI_TIP, dbo.TBLSTSABIT.OLCU_BR1 AS BR, dbo.TBLSTHAR.STHAR_KDV, (CASE WHEN TBLSTHAR.STHAR_GCKOD = 'C' AND TBLSTHAR.STHAR_HTUR IN ('I', 'J', 'K') THEN STHAR_GCMIK * STHAR_NF ELSE 0 END) - (CASE WHEN TBLSTHAR.STHAR_GCKOD = 'G' AND TBLSTHAR.STHAR_HTUR IN ('L', 'M') THEN STHAR_GCMIK * STHAR_NF ELSE 0 END) AS NET_SATIS, dbo.TBLCARIPLASIYER.PLASIYER_ACIKLAMA AS PLAS_ADI, RIGHT(dbo.TBLSTHAR.FISNO, 6) AS F_NO FROM dbo.TBLSTHAR INNER JOIN dbo.TBLSTSABIT ON dbo.TBLSTHAR.STOK_KODU = dbo.TBLSTSABIT.STOK_KODU INNER JOIN dbo.TBLCASABIT ON dbo.TBLSTHAR.STHAR_ACIKLAMA = dbo.TBLCASABIT.CARI_KOD INNER JOIN dbo.TBLCARIPLASIYER ON dbo.TBLSTHAR.PLASIYER_KODU = dbo.TBLCARIPLASIYER.PLASIYER_KODU ORDER BY dbo.TBLSTHAR.SIRA **************************************************************** bu viewin isinizi görecegini umarim.
------------- netsis bir tutkudur.Yaşamak Lazım
|