1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

case sensative search

Discussion in 'MS Access' started by bhushan98, Jan 17, 2007.

  1. bhushan98

    bhushan98 New Member

    Joined:
    Jan 17, 2007
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    hi everyone

    I want to have case sensative serarch

    as
    northwind-employees table

    select * from employees where firstname = "Nancy"

    and
    select * from employees where firstname = "NANCY"

    should not fetch same results


    please help me.

    it is very urgent
     
  2. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,646
    Likes Received:
    86
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    Use the Strcomp() function

    Code:
    select * from employees where StrComp(firstname, "Nancy", 0)
    Code:
    select * from employees where StrComp(firstname, "NANCY", 0)
     
  3. bhushan98

    bhushan98 New Member

    Joined:
    Jan 17, 2007
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    Sorry It dosen't work, It fetch all the records from the table.
     
  4. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,646
    Likes Received:
    86
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    Try using this query

    Code:
    SELECT * FROM employees WHERE StrComp(firstname, "NANCY", 0)=0
     
  5. bhushan98

    bhushan98 New Member

    Joined:
    Jan 17, 2007
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    Thanks a lot I think Its working.

    Many thanks for co-operation

    neeraj
     
  6. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,646
    Likes Received:
    86
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    The pleasure is all mine!
     
  7. bhushan98

    bhushan98 New Member

    Joined:
    Jan 17, 2007
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    Pradeep Ji, Please help me once again

    how to solve this problem with strcomp.. as I using Like funciton in the query
    Tis is a sql query mentioned in vb module --
    srtext - variable
    select * from data where strcomp(trim(userike '" & Trim(srtext) & "%',0)=0


    thanks in advance.
     
  8. bhushan98

    bhushan98 New Member

    Joined:
    Jan 17, 2007
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    sorry the query was :
    "select * from data where trim(hindi) like '" & Trim(srtext) & "%'"

    sorry of inconvinence
     

Share This Page