Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Instr usage please help a poor lad... Post Reply Post New Topic
Author Message
celticpiping
Newbie
Newbie
Avatar

Joined: 25 Oct 2007
Online Status: Offline
Posts: 24
Quote celticpiping Replybullet Topic: Instr usage please help a poor lad...
     Posted: 10 Jan 2008 at 6:25am
So, I have a simple(or so I thought) formula to weed out only records I want.
It looks like this:

{T_Success.zenDateTime} in {?start_date} to {?end_date}
and
InStr ({T_Success.zenAppTDN},"ADOBE",1 )>1

The report works with the first set of logic(the date range),but
I added the second bit of logic this morning, to return only those columns bearing the string "ADOBE".

I now get no returns, though I know there's data with "ADOBE" present.
The column data contains the string  "ADOBE" plus a lot of other text as well.

Thanks..
Rich

IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 10 Jan 2008 at 6:55am
Hi Rich,
 
Yes the logic will only work if both the conditions are satisfied as you are checking with and conditional operator
 
So to get the data with 'ADOBE' it also needs to fall within the date range you have selected....
 
Cheers
Rahul
IP IP Logged
celticpiping
Newbie
Newbie
Avatar

Joined: 25 Oct 2007
Online Status: Offline
Posts: 24
Quote celticpiping Replybullet Posted: 10 Jan 2008 at 7:04am
ok, thanks much for confirming the logic is good.
Rich

IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 10 Jan 2008 at 7:23am
Hi....
 
Does ADOBE start at begining of the string then you would need to check
 
= 1 instead of > 1
 
sample test
 
abcd efghij
 
did some tests......
 
instr(field,'abcd',1) > 1 returns false
instr(field,'abcd',1) =1 returns true
 
instr({field},'abcd',1)  returns 1
 
 
instr(field,'efgh',1) > 1 returns true  
instr({field},'efg',1) returns 6
 
hope that helps 
 
Cheers
Rahul


Edited by rahulwalawalkar - 10 Jan 2008 at 7:26am
IP IP Logged
celticpiping
Newbie
Newbie
Avatar

Joined: 25 Oct 2007
Online Status: Offline
Posts: 24
Quote celticpiping Replybullet Posted: 10 Jan 2008 at 7:34am
I see yer point..
I'll re run & check it out..

IP IP Logged
Lugh
Senior Member
Senior Member
Avatar

Joined: 14 Nov 2007
Online Status: Offline
Posts: 377
Quote Lugh Replybullet Posted: 10 Jan 2008 at 10:47am
Also note that you may get better results, if this is in your selection criteria, by using the LIKE operator.  Like so:

{T_Success.zenDateTime} in {?start_date} to {?end_date}
and
{T_Success.zenAppTDN} LIKE "*ADOBE*"


IP IP Logged
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