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 |
|
peerpressure
Starting Member
2 Posts |
Posted - 2007-07-04 : 14:21:41
|
| I am querying a SQL Server 2000 server remotely and have couple of small syntax problems using the WHERE Clause in a Select statement1. I wish to extract all records where the first 2 characters of a Varchar field (postcode) do not start with 2 specific characters (BT) 2. I wish to extract all records where a Char field is not blank (ie has at least 1 character in it)Many thanksMike |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-07-04 : 14:30:39
|
| 1) select * from table1 where col1 not like 'bt%'2) select * from table1 where datalength(col1) > 0Peter LarssonHelsingborg, Sweden |
 |
|
|
peerpressure
Starting Member
2 Posts |
Posted - 2007-07-04 : 16:14:24
|
| Thanks Works a treat |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-07-04 : 16:22:24
|
| 2) select * from table1 where col1 > ''Peter LarssonHelsingborg, Sweden |
 |
|
|
|
|
|