By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,501 Members | 2,850 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,501 IT Pros & Developers. It's quick & easy.

case sensitive like searches

P: n/a
I am facing a problem writing a query.
The problem is I have a column with different formulas of chemical
molecules. for eg CH3Cl
CbF-(Cb2)
CBF-(Ca)
Now I wrote this query
SELECT *from tbl where MolFormula LIKE 'Cb%'

This returns me row 2 and row 3 whereas I just need row 2 to be
returned. I am using MS Access. Thanks for looking into it.

Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Unfortunately Access is case insensitive. Your query is going to have
to get a little uglier. :)
Try adding something to the effect of WHERE StrComp(Left([MolFormula
],2),"Cb",0)=0
You can find out more about left and StrComp in help
Left([MolFormula],2) will give you the left 2 characters
StrComp can do the binary comparison.
if you want the number of chars variable, you could do something like
WHERE StrComp(Left([MolFormula ],len([Please Enter Search
String])),[Please Enter Search String],0)=0
HTH
Pachydermitis

Nov 13 '05 #2

P: n/a
You are in luck - mssql has a setting that allows you to make it case
sensitive

Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.