Tidak akan berjalan terus mendapatkan kesalahan. Saya telah mengubah kode dengan cara yang berbeda tetapi tetap mendapatkan kesalahan yang sama. Ada yang punya saran?

SELECT *
From (
Select      R.CREATED as Created, 

        Case WHEN R.SR_AREA = 'OB 1st' THEN 'OB Res 2nd'  When R.SR_AREA = 'OB Res 2nd' THEN 'OB Res 3rd' Else R.SR_AREA END as [SR_AREA] 

FROM        S_SRV_REQ AS R WITH (NOLOCK) 

WHERE       (R.INS_PRODUCT = 'Pending OB') AND 
        (R.CREATED BETWEEN @StartDate AND dateadd(d,1,@EndDate)) AND 
        (R.SR_AREA in('OB 1st','OB Res 2nd','OB Res 3rd')) AND 
        (R.RESOLUTION_CD = 'No Answer') 

UNION



SELECT      TOP (100) PERCENT R.SR_AREA, 
        R.RESOLUTION_CD 


FROM        S_SRV_REQ AS R WITH (NOLOCK) 

WHERE       ((R.INS_PRODUCT = 'Pending OB') AND (R.LAST_UPD BETWEEN @StartDate AND dateadd(d,1,@EndDate)) AND 
        (R.SR_AREA in('Inbound', 'OB Res 3rd')) OR (R.RESOLUTION_CD <> 'No Answer'))
sql
0
kickster09 15 Maret 2017, 20:38

2 jawaban

Jawaban Terbaik

Anda melewatkan ) terakhir di akhir pernyataan Anda.

 Select * From (
           .....
               ) <---
0
Koby Douek 15 Maret 2017, 17:39

Buka (harus cocok dengan penutupan) periksa apakah saya melihat Anda memiliki satu yang belum ditutup (

0
YouKnowWhoIAm 15 Maret 2017, 17:41