Click here to Skip to main content
15,868,141 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have a requirement, where I have to fetch records from MS access database like this

Suppose i have a table with name EMP and column with name ID

My query is
SQL
select * from emp where id='-----' 


In my table, I have something like this
ID     name     dob
Test   testing  27-06-2013
test   xxxxx    30-02-2013


Now I have to retrieve these records separately considering the case.

Thanks in advance
Posted
v2
Comments
Rajesh Anuhya 27-Jun-13 3:26am    
No Effort
Member 9195998 27-Jun-13 3:33am    
in the first place is ID your primary key? if not then i suggest you make the selection from the primary key

 
Share this answer
 
Comments
Thanks7872 27-Jun-13 3:34am    
Must agree with comment as well as suggession. ↑voted.
Rajesh Anuhya 27-Jun-13 3:54am    
Thanks
Refer
How to make SQL case sensitive[^].

Solutions
  1. Use COLLATE Latin1_General_CS_AS
    Quote:
    SQL
    SELECT col FROM table  
    WHERE col COLLATE Latin1_General_CS_AS = 'value'
  2. Use StrComp Function
    Quote:
    SQL
    WHERE StrComp('myText1', 'MYTeXt1', 0) = 0

    Documentation[^]
    Here 0 in the method signature -> vbBinaryCompare, which performs a binary comparison.
    It will be a Case Sensitive comparision.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900