the task: show comment up to before a # is found
the sql:
select regexname,iif(CHARINDEX(comment,'#')>1,
substring(comment,1,CHARINDEX(comment,'#')-1), comment) as tips ,CHARINDEX(comment,'#') from regex where comment like '%COnfirmation slip' or RegexName like '%pdf%'
the failed result
regexname tips (No column name)
ADTxPDFHtml AD Tx (Confirmation slip) Pdf download html #revised 141031 0.....
what did do wrong?
Go to the complete details ...