By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,963 Members | 2,016 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,963 IT Pros & Developers. It's quick & easy.

how to print last character as to be in upper case and remainig characters has to be

P: 1
i need to print last character in a word as upper case and remaining characters has to be in lower case
for example :
company is my word
i need to print it as companY
Nov 11 '17 #1
Share this Question
Share on Google+
1 Reply

Uncle Dickie
P: 67
Use a combination of the UPPER and LOWER functions e.g.

Expand|Select|Wrap|Line Numbers
  1. DECLARE    @text as varchar(5)
  2. SET    @text = 'Hello'
  4. SELECT    lower(left(@text,LEN(@text)-1)) + UPPER(RIGHT(@text,1))
Nov 22 '17 #2

Post your reply

Sign in to post your reply or Sign up for a free account.