How to match an alphanumeric string data in a field?

Discussion in 'Databases' started by wonder_gal, Dec 1, 2005.

  1. #1
    I would like to return a total number of records from a table in which their 'inMessage' field matches the a string with a format like this, eg. "55 213 aaa 58"

    Can anyone tell me how shall i write the sql statement?


    
    SELECT COUNT(*) AS Total FROM Inlog WHERE Message LIKE '???'
    
    Code (markup):
    What shall i put as my comparison parameter?
     
    wonder_gal, Dec 1, 2005 IP
  2. Michau

    Michau Well-Known Member

    Messages:
    188
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    108
    #2
    Do you want to find all the fields that contain these characters as a substring? Then you would write LIKE '%your_substring%';
     
    Michau, Dec 5, 2005 IP