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 |
Antonio
Posting Yak Master
168 Posts |
Posted - 2007-06-13 : 09:35:57
|
Greetings,One of my database objects has a column that contains what we call a P number.The format is AAA123456. That is 3 (A-Z) characters then 6 numbers (0-9). Some P number might have a gap between the characters and the numbers. For example AB 128642 or B 539447 etc..I want to search for this kind of patters but why doesn't this work ?like '[ABCDEFGHIJKLMNOPQRSTUVWXYZ][ABCDEFGHIJKLMNOPQRSTUVWXYZ][ABCDEFGHIJKLMNOPQRSTUVWXYZ][0123456789][0123456789][0123456789][0123456789][0123456789][0123456789]' Your help would be appreciated!_________________________________________________________________________________________________________________________Inability is a disaster; patience is bravery; abstinence is a treasure, self-restraint is a shield; and the best companion is submission to Divine Will. |
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2007-06-13 : 09:40:53
|
trylike '[A-Z ][A-Z ][A-Z ][0-9][0-9][0-9][0-9][0-9][0-9]'_______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenp |
 |
|
Antonio
Posting Yak Master
168 Posts |
Posted - 2007-06-13 : 10:12:21
|
quote: Originally posted by spirit1 trylike '[A-Z ][A-Z ][A-Z ][0-9][0-9][0-9][0-9][0-9][0-9]'_______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenp
Spirit thanks mate._________________________________________________________________________________________________________________________Inability is a disaster; patience is bravery; abstinence is a treasure, self-restraint is a shield; and the best companion is submission to Divine Will. |
 |
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2007-06-13 : 10:37:02
|
you're welcome _______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenp |
 |
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-06-13 : 10:45:50
|
quote: Originally posted by spirit1 trylike '[A-Z ][A-Z ][A-Z ][0-9][0-9][0-9][0-9][0-9][0-9]'_______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenp
I don't think that will help you find out values with gaps.Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
|
|