Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get the first letter of an existing column's data only? 4

Status
Not open for further replies.
Apr 3, 2003
180
US
Hello all,
I have quick question about a problem I just ran into. I have a tabel with the following columns,
FirstName
LastName
EmployeeID
FirstNameInitial
Is there an sql command that I can run to populate the FirstNameInitial column with just the first letter of the FirstName column. I have 2500 records and do not want to manually input this info. Thanks for your time.

"I hear and I forget. I see and I remember. I do and I understand."
- Confucius (551 BC - 479)
 
Code:
Update Table
Set    FirstNameInitial = Left(FirstName, 1)

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
update tablename set FirstNameInitial = left(FirstName, 1)
 
left(first_name, 1)

I'd suggest doing this as a computed column so that all future inserts will be put in automatically.

"NOTHING is more important in a database than integrity." ESquared
 
George, one I can finally answer and you beat me. [smile]
djj
 
Sorry. [blush]

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Thanks to you all.

"I hear and I forget. I see and I remember. I do and I understand."
- Confucius (551 BC - 479)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top