between operator for VARCHAR values
Hi there,
I am trying to compare one varchar value between two varchar values which is not working.
for e.g. in my table there are two columns.
FROMpcode(column1)
*****************
L6P 0A1
L6A 0A1
TOpcode(column2)
****************
L7E 5S1
L6A 4R1
the value I want to compare for between FROMpcode and TOpcode is L6S 6B7. here is the query. this is for Canadian postal code comparison.
select * from mytablename where L6S 6B7 between FROMpcode and TOpcode
I can not convert FROMpcode , TOpcode into numbers as they are alphanumeric data.
thanks for your help.
Techie_nas