Results 1 to 5 of 5

Thread: [RESOLVED] [2005] Crystal Report "like" Statement passing.

  1. #1

    Thread Starter
    Lively Member smilbuta's Avatar
    Join Date
    Apr 2005
    Location
    Orlando
    Posts
    104

    Resolved [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.

  2. #2
    PowerPoster 2.0 Negative0's Avatar
    Join Date
    Jun 2000
    Location
    Southeastern MI
    Posts
    4,367

    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.

  3. #3

    Thread Starter
    Lively Member smilbuta's Avatar
    Join Date
    Apr 2005
    Location
    Orlando
    Posts
    104

    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.

  4. #4
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    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 *

  5. #5

    Thread Starter
    Lively Member smilbuta's Avatar
    Join Date
    Apr 2005
    Location
    Orlando
    Posts
    104

    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
  •  



Click Here to Expand Forum to Full Width