|
-
Apr 24th, 2007, 01:30 PM
#1
Thread Starter
Lively Member
[RESOLVED] [2005] Crystal Report "like" Statement passing.
Hello , community.
Im having an ussue with crystal reports. and VB.net.
Im trying to pass a selection formula:
Code:
CrystalReportViewer1.SelectionFormula = "{EQ_Equipment.equipment_cf_tag} like '73'"
This fails to return any rows.
but if i use the following
Code:
CrystalReportViewer1.SelectionFormula = "{EQ_Equipment.equipment_cf_tag} = '73'"
I get the correct line of data...
What am i doing wrong???
EDIT: I just discoverd something odd... I created a record withthe number 1173
If i do a like Search on 1173 it finds the record... if i do alike searc on just 73 it returns no record.. WHAT?...
Last edited by smilbuta; Apr 24th, 2007 at 01:42 PM.
-
Apr 24th, 2007, 01:44 PM
#2
Re: [2005] Crystal Report "like" Statement passing.
I think when you use a like you need to pass a wildcard. I beleive Crystal uses a * for multiple chars and a ? for single chars.
-
Apr 24th, 2007, 01:54 PM
#3
Thread Starter
Lively Member
Re: [2005] Crystal Report "like" Statement passing.
Oh.. do you mean like '*73*'???
Similar to SQL using '%73%'????
Remeber im using the Built in Crystal Reports in Visual Studio 2k5.
-
Apr 24th, 2007, 01:57 PM
#4
Re: [2005] Crystal Report "like" Statement passing.
if you want every record where EQ_Equipment.equipment_cf_tag has a 73 in it, then yes, you would use '*73*'
if you only want ones that start with 73 then it would just be '73*'
like Neg0 mentioned above, for just single character wildcards, use ? instead of *
-
Apr 24th, 2007, 03:02 PM
#5
Thread Starter
Lively Member
Re: [2005] Crystal Report "like" Statement passing.
Thanks both, Worked. I have book on Crystal and VB.net from Wrox and it does not mention the Wild card anywhere!!! DOH!...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|