SQL Sorgu Sipariş Detayları

Murat OSMA

Yönetici
Site Yöneticisi
Katılım
25 May 2018
Mesajlar
1,334
En iyi yanıt
11
Puanları
113
Konum
İstanbul
Web sitesi
excelarsivi.com
Ad Soyad
Murat OSMA
Office Versiyon
Office 365 TR+EN
Logo'da Sipariş Detayları için bu sorguyu kullanabilirsiniz.

[HIDEREPLYTHANKS]
SQL:
SELECT O.DATE_ AS TARIH, O.DUEDATE GELECEGITARIH,
(SELECT FICHENO FROM LG_500_01_ORFICHE WHERE LOGICALREF=O.ORDFICHEREF)FISNO,
(SELECT CODE FROM LG_500_ITEMS WHERE LOGICALREF=O.STOCKREF)STOKKODU,
(SELECT NAME FROM LG_500_ITEMS WHERE LOGICALREF=O.STOCKREF)STOKADI,
(SELECT CODE FROM LG_500_CLCARD WHERE LOGICALREF=O.CLIENTREF)CARIKODU,
(SELECT DEFINITION_ FROM LG_500_CLCARD WHERE LOGICALREF=O.CLIENTREF)CARIADI,
O.AMOUNT SIPARISMIKTARI, O.SHIPPEDAMOUNT AS TESLIMMIKTARI, AMOUNT-SHIPPEDAMOUNT BEKLEYENSIPARIS,
O.PRICE AS BIRIMFIYAT,
ROUND((O.AMOUNT-O.SHIPPEDAMOUNT)*O.PRICE,4) AS TLTOPLAMFIYAT,
(SELECT CURCODE FROM L_CURRENCYLIST WHERE FIRMNR=500 AND CURTYPE=O.PRCURR) AS RAPORLAMADOVIZI,
O.PRPRICE AS RAPORLAMADOVIZKURU,
CASE WHEN O.PRPRICE>0 THEN ROUND((O.AMOUNT-O.SHIPPEDAMOUNT)*(O.PRICE/O.PRPRICE),4) ELSE 0 END RAPORLAMADOVIZKARSILIGI,
(SELECT CURCODE FROM L_CURRENCYLIST WHERE FIRMNR=500 AND CURTYPE=O.TRCURR) AS ISLEMDOVIZI,
O.TRRATE AS ISLEMDOVIZKURU,
CASE WHEN O.TRRATE>0 THEN ROUND((O.AMOUNT-O.SHIPPEDAMOUNT)*(O.PRICE/O.TRRATE),4)ELSE 0 END ISLEMDOVIZKARSILIGI
FROM LG_500_01_ORFLINE O
WHERE O.TRCODE=2 AND O.CANCELLED=0 AND O.CLOSED=0 AND O.AMOUNT-O.SHIPPEDAMOUNT>0
AND O.STOCKREF=(SELECT LOGICALREF FROM LG_500_ITEMS WHERE CODE='1000120LNWH')
[/HIDEREPLYTHANKS]
 
Son düzenleme:
Üst Alt