[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?...
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.
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.
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 *
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!...