By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,197 Members | 1,205 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,197 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
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
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

Nov 13 '05 #2

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

Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.