If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

How to determine if string starts with Alpha or Numeric

Started by kristyparker_concur, 11 Aug 2022 09:29:07 AM

Previous topic - Next topic

kristyparker_concur

Hello,

I am trying to determine if a string starts with a number. This is what I am trying to say...

CASE WHEN [Level 2] starts with *number* THEN ([Level 3] + [Level 2]) ELSE '' END

I can't figure out how to say 'starts with a number' though...

Any help is appreciated!
Thank you

dougp

You're using + as a string concatenation operator, so I'll assume you are using SQL Server.


case
when isnumeric(substring ([Level 2], 1, 1)) = 1 then [Level 3] + [Level 2]
else ''
end

kristyparker_concur