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 |
|
juliemac
Starting Member
12 Posts |
Posted - 2011-10-14 : 09:23:46
|
| I have a column of data in an Excel spreadsheet. One Col, called Dept has a 4 digit name EG: A123. Also in that col is a total EG A123 Total.I want the SQL to only include data where the len is equal to 4, not greater.Thanks! |
|
|
Grifter
Constraint Violating Yak Guru
274 Posts |
Posted - 2011-10-14 : 09:53:15
|
How are you using SQL in excel, are you doing VBA with SQL statement or something?If you want to show data from a column where it is only 4 chars in length then:select yourdatafrom yourtablewhere len(yourdata) = 4 G |
 |
|
|
juliemac
Starting Member
12 Posts |
Posted - 2011-10-14 : 10:32:52
|
| Perfect! Many thanks! |
 |
|
|
|
|
|