SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2010
    Posts
    38
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Post Help to this search functionality please...

    I have this code:



    Code:
        if prtLastName <> "" then
            if ubound(split(prtLastName, ",")) > 0 then
                'last name, first name search
                query = query & " AND eofEMPLOYEES.emp_lastName LIKE N'" & ccDB.LIKEify(split(prtLastName, ",")(0)) & "%'"
                query = query & " AND eofEMPLOYEES.emp_firstName LIKE N'" & ccDB.LIKEify(trim(split(prtLastName, ",")(1))) & "%'"
            else
                query = query & " AND ("
                query = query & "    eofEMPLOYEES.emp_lastName LIKE N'" & ccDB.LIKEify(prtLastName) & "%'"
                query = query & "     OR eofEMPLOYEES.emp_firstName LIKE N'" & ccDB.LIKEify(prtLastName) & "%'"
                query = query & "     OR eofEMPLOYEES.emp_emailAddress LIKE N'" & ccDB.LIKEify(prtLastName) & "%'"
                query = query & "    OR dtaPASSWORDS.pwd_password = N'" & ccDB.LIKEify(prtLastName) & "'"
                query = query & " )"
            end if
        end if



    The code performs well with the following searches:

    1. last name, first name search such as Moore, Roger

    2. last name only such as Moore

    3. first name only such as Roger

    4. email address only such as roger_more@terrific.com

    5. password such TGBGGKD



    What I need to add in the code where it is capable also to search for firstname lastname such as Roger Moore or it is capable to search like Alberto de Gonzales.

    Can you help me guys on this.



    Thanks in advance

  2. #2
    SitePoint Enthusiast
    Join Date
    Feb 2010
    Posts
    38
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Please post your reply and help.


Bookmarks

Posting Permissions

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