Connecting Tech Pros Worldwide Forums | Help | Site Map

Picking out a part of a string...

jamesd0142's Avatar
Needs Regular Fix
 
Join Date: Sep 2007
Location: Wales
Posts: 467
#1: Oct 19 '07
Hi,

i have a temp table called 'temp2'

within this are values usch as

"abc"
"acb"

i want to pick out the values minus the " quotes

how can this be done?

azimmer's Avatar
Expert
 
Join Date: Jul 2007
Posts: 199
#2: Oct 19 '07

re: Picking out a part of a string...


Quote:

Originally Posted by jamesd0142

Hi,

i have a temp table called 'temp2'

within this are values usch as

"abc"
"acb"

i want to pick out the values minus the " quotes

how can this be done?

If you always have both quotes in the string, you can try the following:
Expand|Select|Wrap|Line Numbers
  1. SELECT left(right(myCol,len(myCol)-1),len(myCol)-2)
  2. FROM temp2
  3.  
jamesd0142's Avatar
Needs Regular Fix
 
Join Date: Sep 2007
Location: Wales
Posts: 467
#3: Oct 19 '07

re: Picking out a part of a string...


Quote:

Originally Posted by azimmer

If you always have both quotes in the string, you can try the following:

Expand|Select|Wrap|Line Numbers
  1. SELECT left(right(myCol,len(myCol)-1),len(myCol)-2)
  2. FROM temp2
  3.  

exactly what i needed thanks alot!
Reply


Similar Microsoft SQL Server bytes