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 |
|
nychick
Starting Member
2 Posts |
Posted - 2010-10-21 : 00:13:15
|
| How can I select the first letter of the first name and then last name with proper spacing?I.E. John Smith isJ. Smith |
|
|
Sachin.Nand
2937 Posts |
Posted - 2010-10-21 : 01:14:27
|
| declare @nm as varchar(20)='John Smith'select left(@nm,1) + '. ' + substring(@nm,(charindex(' ',@nm)),len(@nm))PBUH |
 |
|
|
nychick
Starting Member
2 Posts |
Posted - 2010-10-21 : 01:19:08
|
quote: Originally posted by Sachin.Nand declare @nm as varchar(20)='John Smith'select left(@nm,1) + '. ' + substring(@nm,(charindex(' ',@nm)),len(@nm))PBUH
thanks for your quick reply. I should of rephrased my question.I have two columns fname, lname and I need to change the format to F. Lastname of the entire table.This is in Oracle SQL. Thanks again |
 |
|
|
Sachin.Nand
2937 Posts |
|
|
|
|
|