Report Design
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Report Design
Message Icon Topic: Using Substring Post Reply Post New Topic
Author Message
crystalgal
Groupie
Groupie
Avatar

Joined: 20 Feb 2009
Location: United States
Online Status: Offline
Posts: 66
Quote crystalgal Replybullet Topic: Using Substring
    Posted: 11 Jun 2010 at 7:12am
Hello all,
I am trying to include the substring in my select statement and something is not right, can anyone help.
 
I need to get 2 different words "Campus" and "DL" from the string.
They do not have specific lenth so I tried following

select (substr('string1', Instr('string','Campus',1,1)) from table

select (substr('string1', Instr('string1','DL',1,1)) from table

but it is not working. and is there a wayto concatinate 2 substr statements?
 
Really appreciate any help. TIA
 
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3701
Quote hilfy Replybullet Posted: 11 Jun 2010 at 9:29am

Please don't cross-post.  See my response here.

-Dell

IP IP Logged
chellamurugaraj
Newbie
Newbie
Avatar

Joined: 11 Mar 2010
Location: India
Online Status: Offline
Posts: 19
Quote chellamurugaraj Replybullet Posted: 12 Jun 2010 at 2:35am
first declare string variable.....
and then simply add what string u would like to add to that string variable..
for example;;;;;;

dim sqlvar as string
sqlvar="select Campus,DL "
sqlvar + = "from Tablename"

******** rajse********
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.051 seconds.