當我執行唯一工作的是Zipcodes。它不會給我的服務日期大於08/01/16或我的結算提供商。我不知道爲什麼。爲什麼我的代碼被忽略?
SELECT Name, BirthDate, Address1, Address2, City, StateProvince, ZipCode, BillingProviderID, ServiceDate, ChargeCatID
FROM dbo.PbrChargeTransactions
WHERE ChargeCatID = 'EM'
AND ServiceDate >= '08/01/16'
AND BillingProviderID IN ('AAD.FD','DSD.DFD','ASDF.DD')
AND ZipCode Like '68730%'
OR ZipCode Like '68792%'
OR ZipCode Like '68739%'
OR ZipCode Like '68718%'
OR ZipCode Like '57069%'
OR ZipCode Like '57031%'
OR ZipCode Like '57078%'
OR ZipCode Like '57066%'
OR ZipCode Like '57063%'
OR ZipCode Like '57037%'
OR ZipCode Like '57073%'
OR ZipCode Like '57029%'
OR ZipCode Like '57070%'
ORDER BY Name
你需要一些括號:現在,你得到(ChargeCatID ='EM'和ServiceDate> = '08/01/16'和BillignProviderID IN(...)和ZipCode Like'68730%')或者(ZipCode像'68792%')或(ZipCode贊...)。顯然,那不是你想要的。 – Martha