Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Highlighted
Jacob
New Contributor II

DECODE in SQL

Hi All,

I am using Decode function in my script but i am an error.

 

sql SELECT 

DECODE(ISNULL(STORE_NUMBER,'*'),'*',SAGE_WH,STORE_NUMBER) AS STORE_NUMBER,
.......
.....
From ......

 

 

Error 

 

Connector reply error: SQL##f - SqlState: 37000, ErrorCode: 195, ErrorMsg: [Microsoft][ODBC SQL Server Driver][SQL Server]'DECODE' is not a recognized built-in function name.: sql SELECT DECODE(ISNULL(STORE_NUMBER,'*'),'*',SAGE_WH,STORE_NUMBER) AS STORE_NUMBER, 

 

 

Labels (5)
1 Reply
MVP
MVP

Re: DECODE in SQL

DECODE() is not a valid function in SQL Server. Use a CASE statement instead
Logic will get you from a to b. Imagination will take you everywhere. - A Einstein