Author |
Topic  |
|
ravilobo
Flowing Fount of Yak Knowledge
India
1184 Posts |
Posted - 03/16/2005 : 08:43:21
|
In oracle.. select initcap('abcd') from dual; returns Abcd
Do we have a similar function in SQL2K? How to achieve this...
------------------------ I think, therefore I am |
|
spirit1
Cybernetic Yak Master
Slovenia
11752 Posts |
Posted - 03/16/2005 : 08:46:20
|
no you must do select upper(left(colName, 1)) + substring(colName, 2, len(colName)) as colName
Go with the flow & have fun! Else fight the flow  |
 |
|
ravilobo
Flowing Fount of Yak Knowledge
India
1184 Posts |
Posted - 03/16/2005 : 08:51:46
|
OK. Thanks for the code. As long as there is way to do it..its OK with me. Had seen the same function in foxpro...that is long back....
------------------------ I think, therefore I am |
 |
|
spirit1
Cybernetic Yak Master
Slovenia
11752 Posts |
Posted - 03/16/2005 : 08:53:56
|
way long back...  
Go with the flow & have fun! Else fight the flow  |
 |
|
ravilobo
Flowing Fount of Yak Knowledge
India
1184 Posts |
Posted - 03/16/2005 : 08:57:13
|
Yep. ...loved foxpro..sort of created a big wave...that time.
------------------------ I think, therefore I am |
 |
|
spirit1
Cybernetic Yak Master
Slovenia
11752 Posts |
Posted - 03/16/2005 : 09:03:57
|
i didn't. worked with it in 96... one of the first incarnations... left it alone from then on 
Go with the flow & have fun! Else fight the flow  |
 |
|
Kristen
Test
United Kingdom
22859 Posts |
Posted - 03/16/2005 : 09:24:34
|
Do you just want a single initial CAP? Or Were You Looking For Title Caps?
Kristen |
 |
|
ravilobo
Flowing Fount of Yak Knowledge
India
1184 Posts |
Posted - 03/16/2005 : 09:41:38
|
Just want a single initial cap....but would love to see a code which is doing title caps...
------------------------ I think, therefore I am |
 |
|
Kristen
Test
United Kingdom
22859 Posts |
Posted - 03/16/2005 : 10:43:10
|
Several examples on SQL Team ... which saves me a job!
Kristen |
 |
|
TG
Flowing Fount of Yak Knowledge
USA
6065 Posts |
Posted - 03/16/2005 : 10:51:28
|
You Tease!
Be One with the Optimizer TG |
 |
|
Kristen
Test
United Kingdom
22859 Posts |
Posted - 03/16/2005 : 11:10:16
|
"Several examples on SQL Team" is always a safe bet around these parts. If I'm wrong we'll just have to set it up as a Challenge!
Kristen |
 |
|
sql_cable_guy
Starting Member
1 Posts |
Posted - 05/09/2005 : 07:54:48
|
hmm Title caps.. Have to think about that one A previous response select upper(left(colName, 1)) + substring(colName, 2, len(colName)) as colName works with 'abcd'
This works with 'ABCD' or 'abcd' to give you initcap.
select upper(left(lower(colName), 1)) + substring(lower(colName), 2, len(colName)) as colName |
 |
|
|
Topic  |
|