Link to home
Start Free TrialLog in
Avatar of hcarvajal
hcarvajal

asked on

Upper and lowercase in a query

Hello,
I have a table where the users may enter names in upper and/or lowercase. I could have, for example, NAME1 equal to 'ABEL MARY' and NAME2 equal to 'deBlank John'. The query in the code does the following:

select count(*) from table
where upper(name) >= :NAME1
and upper(name) <= :NAME2

but that is obviously resulting in a restricted data set and it does not covers the lowercase names. Considering that the user may type either NAME1 and/or NAME2 with upper or lowercases, how would it be the best way to cover all the data range in the table?
thanks

ASKER CERTIFIED SOLUTION
Avatar of Nick Upson
Nick Upson
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
select count(*) from table
where upper(name) >= upper(:NAME1)
and upper(name) <= upper(:NAME2)