case sensative search

Light Poster
17Jan2007,17:28   #1
bhushan98's Avatar
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
Team Leader
17Jan2007,18:31   #2
pradeep's Avatar
Use the Strcomp() function

Code: SQL
SELECT * FROM employees WHERE StrComp(firstname, "Nancy", 0)

Code: SQL
SELECT * FROM employees WHERE StrComp(firstname, "NANCY", 0)
Light Poster
18Jan2007,10:55   #3
bhushan98's Avatar
Sorry It dosen't work, It fetch all the records from the table.
Team Leader
18Jan2007,11:02   #4
pradeep's Avatar
Try using this query

Code: SQL
SELECT * FROM employees WHERE StrComp(firstname, "NANCY", 0)=0
Light Poster
18Jan2007,11:10   #5
bhushan98's Avatar
Thanks a lot I think Its working.

Many thanks for co-operation

neeraj
Team Leader
18Jan2007,11:16   #6
pradeep's Avatar
The pleasure is all mine!
Light Poster
18Jan2007,14:34   #7
bhushan98's Avatar
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.
Light Poster
18Jan2007,14:35   #8
bhushan98's Avatar
sorry the query was :
"select * from data where trim(hindi) like '" & Trim(srtext) & "%'"

sorry of inconvinence