October 28, 2010 at 4:51 am
hi, can anyone help please.
trying to do a between statement but using a wildcard within it. eg
where
Primary_Diagnosis between 'C00%' and 'C14%'
is this correct way to do it?
as the values could be C001,C002,C141.... etc
October 28, 2010 at 4:57 am
You will have to be careful of collation issues but
between 'C00' and 'C14ZZZZZZZZZZZZZZZZ'
will do what you need.
October 28, 2010 at 12:58 pm
http://www.codeproject.com/KB/database/SQL_LIKE_Operator.aspx
I hope this will help you solve the issue.
Good luck!
October 7, 2015 at 10:01 am
Did you ever resolve this problem? The response re: http://www.codeproject.com/Articles/33941/SQL-LIKE-Operator
was not the correct answer for this problem.
I have found that adding zzzz to the end range works. Is there anything more elegant than that?
October 7, 2015 at 7:51 pm
Instead of
WHERE Primary_Diagnosis between 'C00%' and 'C14%'
Just have :
WHERE Primary_Diagnosis >='C00'
AND Primary_Diagnosis <= 'C1499999'
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply