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 |
Bunks
Starting Member
10 Posts |
Posted - 2010-07-25 : 17:44:08
|
Hi allI have a query that I think should be easy but my limited sql skills are making it hard for me!I want to return just the first name for a member in a column in a table - regardless of whether they have a middle name or not.Example of the data:John HenryStevenLewis TrevorIanI just want to return:JohnStevenLewisIanHalp!Thanks so much...... |
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2010-07-25 : 19:06:04
|
SELECT Left(myColumn, CharIndex(' ', myColumn + ' ')-1) FROM myTable |
|
|
Bunks
Starting Member
10 Posts |
Posted - 2010-07-25 : 21:17:55
|
Thanks a lot - I'll try that! |
|
|
|
|
|