Go4Expert

Go4Expert (http://www.go4expert.com/)
-   MS Access (http://www.go4expert.com/forums/ms-access-forum/)
-   -   case sensative search (http://www.go4expert.com/forums/case-sensative-search-t2593/)

bhushan98 17Jan2007 17:28

case sensative search
 
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

pradeep 17Jan2007 18:31

Re: case sensative search
 
Use the Strcomp() function

Code: SQL

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


Code: SQL

SELECT * FROM employees WHERE StrComp(firstname, "NANCY", 0)


bhushan98 18Jan2007 10:55

Re: case sensative search
 
Sorry It dosen't work, It fetch all the records from the table.

pradeep 18Jan2007 11:02

Re: case sensative search
 
Try using this query

Code: SQL

SELECT * FROM employees WHERE StrComp(firstname, "NANCY", 0)=0


bhushan98 18Jan2007 11:10

Re: case sensative search
 
Thanks a lot I think Its working.

Many thanks for co-operation

neeraj

pradeep 18Jan2007 11:16

Re: case sensative search
 
The pleasure is all mine!

bhushan98 18Jan2007 14:34

Re: case sensative search
 
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.

bhushan98 18Jan2007 14:35

Re: case sensative search
 
sorry the query was :
"select * from data where trim(hindi) like '" & Trim(srtext) & "%'"

sorry of inconvinence


All times are GMT +5.5. The time now is 09:25.