Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003
    Posts
    37

    Question Unanswered: Transact SQL - Does it have the equivalent of FINDONEOF function?

    Hi All,
    Once again I find myself smacking my head into a wall (and it will probably be for naught). I'm trying to find a specific character in a string within a specific record. I've tried substring, but it's not quite getting me where I want to be. I even tried "nesting" the substring and got nowhere (but I could have had the syntax wrong when I nested it).

    Here is a sample

    Select substring(productimagefile, 20, 5)
    from my table

    What I need is something like this:

    Select substring(findoneof(productimagefile, _r, 1), 1, 5)
    from my table

    Actually, on the start of the substring, I need it to be where it finds the _r, just not sure how to tell it that.
    The replace function is the closest I've seen to what I need, but I don't want to replace it with anything, I just need to find it in the string.

    So, if anyone has any ideas, I'd be grateful (and my head would stop hurting....)

    Schimelcat

  2. #2
    Join Date
    Jul 2003
    Location
    The Dark Planet
    Posts
    1,401
    Charindex() / Patindex() ???
    Get yourself a copy of the The Holy Book

    order has no physical Brett in The meaning of a Kaiser . -database data

Posting Permissions

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