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 |
|
nothingman_cdn
Starting Member
4 Posts |
Posted - 2007-03-06 : 14:52:10
|
| Have a Invoice column that is char(25) The Invoice numbers range in length from 1 to 25. Is it possible to select only the invoice numbers that are exactly 10 in length? Some stuff I tried ends up truncating the invoice numbers that are bigger than 10. So I am not getting accurate results. Also not sure if this matters or not. But if a number is not 25 characters in length. The rest of the field is padded with spaces. Invoice # --------------------------1234567891012 1111 444444 9999999999 9878974537894758475948 3456543789 023850938594859043859048 2304887584 So for example on the listing above. The return results I would be looking for are:9999999999 3456543789 2304887584 |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2007-03-06 : 14:58:28
|
| select [Invoice #] from MyTable where len([Invoice #]) = 10CODO ERGO SUM |
 |
|
|
|
|
|