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)
 query substring match

Author  Topic 

desikankannan
Posting Yak Master

152 Posts

Posted - 2008-04-07 : 09:03:37
hi,
how to execute a query for that items
example i have itemcode '602-10143w-std' and i have refno '10143w'

select fldoraitem from tbloraitem where fldoraitem = '& refno& "'

i need 10143w for the itemcode not '602-10413w-std'
'602-10413w-std' = '10413w' i want to trim 602- in the right and
-std in the left


Desikankannan

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2008-04-07 : 09:07:45
[code]Where fldoraitem like '%-' + refno + '-%'[/code]

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

desikankannan
Posting Yak Master

152 Posts

Posted - 2008-04-09 : 09:34:50
hi,
i tried but its not working please guide me very urgent.

Desikankannan
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-04-09 : 09:46:20
SELECT PARSENAME(REPLACE(ItemCode, '-', '.'), 2)
FROM Table1



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page
   

- Advertisement -