Click here to Skip to main content
15,895,829 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

i need to find string in database column...and print my string if it present in string


VB
if instr({bustruct.name},"AFS",1)<0 then
    securitytype = "AFS"
else if instr({bustruct.name},"HTM",1)<0 then
    securitytype = "HTM"

ELSE  securitytype = "HFT"




bustruct.name contains;--.


FI-RM-ITS Long Term
FI-RM-ITS Short Term
When Issue ITS
FI-RM-HTM Long Term
FI-RM-HTM Short Term
When Issue HTM
FI-FC-HTM Long Term

etc....

Thanks,
Uma...
Posted
Updated 24-Aug-11 18:22pm
v2
Comments
Herman<T>.Instance 25-Aug-11 0:47am    
too less code. what do you use to retrieve data from database?
Uma Makineni 25-Aug-11 21:23pm    
i want to test the string "HTM" is present in the bustruct.name or not...
if it is present in the string i want to display as"investment" else "trading"
Uma..
Herman<T>.Instance 26-Aug-11 5:25am    
you are now telling other thimngs than your question.
Prerak Patel 25-Aug-11 2:21am    
Not clear.

1 solution

Try it
SQL
if instr({bustruct.name},"AFS")>0 then
    securitytype = "AFS"
else if instr({bustruct.name},"HTM")>0 then
    securitytype = "HTM"
else
    securitytype = "HFT"
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900