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 |
|
Rupa
Posting Yak Master
123 Posts |
Posted - 2007-11-09 : 07:09:09
|
| Hey allI have an output from a csv file like:Date, Time, StaffNo, Forename, SurnameI want StaffNo from the above. I know I need to use Substring and Charindex..but am kind of lost. I need something to say: give me data between comma position 2 and 3...Any response will be highly appreciated.Many thanks,Rupa |
|
|
Rupa
Posting Yak Master
123 Posts |
Posted - 2007-11-09 : 07:36:40
|
| I am becoming lazy...This worked for me:(Substring(ErrorOutput, 21,(charindex(',',substring(ErrorOutput,21,datalength(ErrorOutput)-21)))-1)) AS StaffNoRupa |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
|
|
|
|