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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Creating a view of just the first letter

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-11-29 : 08:25:56
anthony planet writes "Hi all,

I'm wanting to know how within the View SQL i can just show the first letter of a field. Basically i am creating an address book and want to be about to sort through all the applicates with the same first letter of their last name. In access it's something like this

Left$([LastName],1) AS Alpha

thanks
A"

Seventhnight
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2004-11-29 : 08:33:06
Same deal.... left(LastName,1) As Alpha

You probably should trim as well: left(ltrim(LastName),1) As Alpha

Corey
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2004-11-29 : 08:40:01
well the same is here:
select Left(LastName, 1) as Initial

Go with the flow & have fun! Else fight the flow
Go to Top of Page
   

- Advertisement -