SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 2 of 2
  1. #1
    Junior Member
    Join Date
    Feb 2011
    Posts
    6
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Search for records with characters within a string

    Hi,

    I have searched many forums trying to resolve my problem but all I can find is queries to return the position of a character within a string.

    I have written a query that will return records if the Assigned_Team is equal to such and such, but I also want to add a second parameter for the SUMMARY field that will search for '18' within the whole string of the SUMMARY field.

    Is this possible?

    SELECT
    BUG.BG_BUG_ID as Defect_ID,
    BUG.BG_STATUS as Status,
    BUG.BG_RESPONSIBLE as Assigned_To,
    BUG.BG_SUMMARY as Summary,
    BUG.BG_USER_01 as Assigned_Team,
    BUG.BG_DETECTED_BY as Detected_By,
    BUG.BG_DETECTION_DATE as Detected_Date,
    BUG.BG_SEVERITY as Severity,
    BUG.BG_USER_13 as Release_#,
    BUG.BG_USER_06 as Project_#,
    BUG.BG_VTS as Modified,
    BUG.BG_CLOSING_DATE as Closing_Date
    FROM BUG


    WHERE (BUG.BG_USER_01 = '***' OR
    BUG.BG_USER_01 = '***' OR
    BUG.BG_USER_01 = '***' OR
    BUG.BG_USER_01 = '***' OR
    BUG.BG_USER_01 = '***' OR
    BUG.BG_USER_01 = '***' OR
    BUG.BG_USER_01 = '***') AND
    *Line for string search*

    If you could help it would be greatly appreciated.

    Thanks,
    Adam

  2. #2
    Advanced Member
    Join Date
    Nov 2006
    Posts
    821
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    2 Thread(s)
    Total Downloaded
    0

    Re: Search for records with characters within a string

    The SQL syntax for searching for a string within a string is

    <fieldname> like '%<string>%'

    Where
    <fieldname> is the database field containing the string
    "%" is the wildcard character
    <string> is the string you are searching for
    Trudy C
    (Opinions and information contained in this post are wholly my own and do not reflect the opinions of my employer.)

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.11%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 12:20 PM.

Copyright BetaSoft Inc.