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
 General SQL Server Forums
 New to SQL Server Programming
 Like function not working

Author  Topic 

hspatil31
Posting Yak Master

182 Posts

Posted - 2009-08-28 : 08:04:55
Dear All,

I am haveing following two queary in that like statement description is comeing.
But in bakend i am haveing description FIDELITY TAX ADVANTAGE FUND DIV.
It is not matching coz it is comeing different different places in discription.
So how to match this like discription to my bakend.

1> select SchemeDesc FROM M_SCHEME_DETAILS_GD where SchemeDesc LIKE 'TRANSFER ZWMS07796 4828679 INVESTMENT IN FIDELITY TAX ADVANTAGE F UND DIV'

2> select SchemeDesc FROM M_SCHEME_DETAILS_GD where SchemeDesc LIKE 'TRANSFER N - MONTHLY DIV/R 4837174 INVESTMENT IN FIDELITY TAX ADVANTAGE F UND DIV - RETAIL PLA'

Thnks
Harish

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-08-28 : 08:11:31
use % sign as joker.
where description like '%searchword%'


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

hspatil31
Posting Yak Master

182 Posts

Posted - 2009-08-28 : 08:17:38
Dear Freind,

I used that one also but it is not working,

Coz that FIDELITY TAX ADVANTAGE FUND DIV discription is comeing different different places. And some times it is comeing like
FIDELITY TAX ADVANTAGE F UND DIV
FID ELITY T AX ADVANT AGE F UND DIV

And in my bakend discription is FIDELITY TAX ADVANTAGE FUND DIV

So how to check that one. Is there any different function ?

Example,

LIKE 'TRANSFER ZWMS07796 4828679 INVESTMENT IN FIDELITY TAX ADVANTAGE F UND DIV'

LIKE 'TRANSFER ZWMS07796 4828679 FIDELITY TAX ADVANTAGE F UND DIV INVESTMENT IN '

Thnks
Harish
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-08-28 : 08:26:09
where replace(column,' ','') like '%FIDELITYTAXADVANTAGEFUNDDIV%'


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

hspatil31
Posting Yak Master

182 Posts

Posted - 2009-08-29 : 00:34:13
Dear Freind,

But my description as,

where SchemeDesc LIKE 'TRANSFER N - MONTHLY DIV/R 4837174 INVESTMENT IN FIDELITY TAX ADVANTAGE F UND DIV - RETAIL PLA'

And in database my description is,

FIDELITY TAX ADVANTAGE FUND DIV

Can anybody tell me how to solve this problem ?
Is there any another method ?

Thnks
Harish Patil
Go to Top of Page

vijayisonly
Master Smack Fu Yak Hacker

1836 Posts

Posted - 2009-08-29 : 16:58:44
whats wrong with webfred's method? Did you try it...it removed all spaces within the field and compares it with '%FIDELITYTAXADVANTAGEFUNDDIV%'...why is this not working?
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-08-30 : 11:00:32
At least you should try my solution before you call Can anybody tell me how to solve this problem ?


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -