Results 1 to 2 of 2

Thread: Checking if 1 or items in 1 delimitedString exist in another

  1. #1
    Join Date
    Oct 2010
    Posts
    1

    Checking if 1 or items in 1 delimitedString exist in another

    Hi all,
    Which is the best way to check if an item or more of one delimited string exist in another?
    I'd like to pass 2 delimited strings to a UDF and get back TRUE if at least one item of
    the first delimited string exists in the second delimited string.

    delStr1="US,FR,DE,PL"
    delStr2="GB,DE,CA"
    delStr3="CN,DK,IT"

    udf_CheckDelimitedString(delStr1,DelStr2)= TRUE (DE)
    udf_CheckDelimitedString(delStr2,DelStr3)= FALSE

    Thanks in advance for your help.
    W.

  2. #2
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    Why don't you use CHARINDEX function instead.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •