I am trying to execute the below query.
SELECT
ABL.Address1 AS BillingAddress1,
ABL.Address2 AS BillingAddress2,
ABL.Address3 AS BillingAddress3,
ABL.Address4 AS BillingAddress4,
ABL.UnitNumber AS BillingUnitNumber,
ABL.City AS BillingCity,
ABL.ProvinceOrState AS BillingProvinceOrState,
ABL.PostalCode AS BillingPostalCode,
CASE ISNULL (ABL.CountryCode,'')
WHEN 'CAN' THEN 'CANADA'
WHEN 'CA' THEN 'CANADA'
WHEN 'US' THEN 'USA'
WHEN '' THEN
CASE WHEN CHARINDEX(RTRIM(ABL.ProvinceOrState),'BC,NWT,SK,MB,ON,QC,NB,NS,PEI,NF')>0 THEN 'CANADA' ELSE NULL END
ELSE ABL.CountryCode
END AS BillingCountryCode
but it throwing the below error.
Msg 102, Level 15, State 1, Line 85 Incorrect syntax near ';'.
I am unable to find whats wrong with the query.