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 2008 Forums
 Transact-SQL (2008)
 find last 4 characters of a string

Author  Topic 

HenryFulmer
Posting Yak Master

110 Posts

Posted - 2011-12-11 : 23:09:54
How can I determine the last 4 characters of a string,not knowing how long the string is?

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2011-12-11 : 23:15:21
[code]right( <string> , 4 )[/code]


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

johntech
Yak Posting Veteran

51 Posts

Posted - 2011-12-12 : 08:20:37
Ok i do more clear of syntex try below code
Select RIGHT('helloALL',3) will give 'ALL'.
Go to Top of Page

sunnyleoneo
Starting Member

19 Posts

Posted - 2011-12-12 : 12:57:10
Hi,

For your future reference
http://msdn.microsoft.com/en-us/library/ms181984.aspx

And check description of Right function http://msdn.microsoft.com/en-us/library/ms177532.aspx

Go to Top of Page
   

- Advertisement -