Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
dmilam
Posting Yak Master
185 Posts |
Posted - 2010-09-01 : 14:29:15
|
| By this I mean, how to count or determine the position of a character starting from the right, not from the left. It seems that charindex and patindex start from the left, or am I just misunderstanding them?I have strings that end with A, B, C in the third position from the right, but the string lengths vary. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
dmilam
Posting Yak Master
185 Posts |
Posted - 2010-09-01 : 15:05:50
|
| Reverse! Thanks! |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2010-09-01 : 15:14:52
|
If your goal is to find all records that has either A, B or c as the third character from the right, you can also use LIKE operator.SELECT * FROM Table1 WHERE Col1 LIKE '%[ABC]__' N 56°04'39.26"E 12°55'05.63" |
 |
|
|
|
|
|