Alpha Video Training
Results 1 to 8 of 8

Thread: Filtering a report with 'Contains' function

  1. #1
    Member
    Real Name
    Mark Williams
    Join Date
    Dec 2005
    Posts
    318

    Default Filtering a report with 'Contains' function

    I am attempting to filter a report using the following:

    Contains(Address1,"12345") .and. Contains(Address2,"201")

    This seems to work fine unless the Address2 field contains the # character followed by the suite number without a space between them.

    For example:
    #201 - Record is ignored in the filter
    # 201 - Record is included in the filter
    Suite #201 - Record is ignored in the filter
    Suite # 201 - Record is included in the filter

    I need it to include ALL records that contain '201' regardless of other characters and their placement in the field.

    Appreciate any suggestions.

    p.s. Using build 4254-4863
    Last edited by Mark Williams; 09-26-2019 at 06:52 AM.

  2. #2
    Member
    Real Name
    Andrew Davidowicz
    Join Date
    Aug 2018
    Location
    New Jersey
    Posts
    23

    Default Re: Filtering a report with 'Contains' function

    Try "'12345'$Address1.and.'201'$Address2"

  3. #3
    Member
    Real Name
    Mark Williams
    Join Date
    Dec 2005
    Posts
    318

    Default Re: Filtering a report with 'Contains' function

    Quote Originally Posted by Davidowicza View Post
    Try "'12345'$Address1.and.'201'$Address2"
    I've tried this with various syntax and get an invalid expression error.

    Thanks

  4. #4
    Member
    Real Name
    Andrew Davidowicz
    Join Date
    Aug 2018
    Location
    New Jersey
    Posts
    23

    Default Re: Filtering a report with 'Contains' function

    How exactly are you using it then? I have used this method in a bunch of reports and do not get syntax errors, it works wonders.

    Example of getting all telephone numbers on a report that contain "Rod" in their lastname:
    Code:
    filt = "'Rod'$Lname"
    report.preview("Telephone List", filt)

  5. #5
    Member
    Real Name
    Mark Williams
    Join Date
    Dec 2005
    Posts
    318

    Default Re: Filtering a report with 'Contains' function

    Quote Originally Posted by Davidowicza View Post
    How exactly are you using it then? I have used this method in a bunch of reports and do not get syntax errors, it works wonders.

    Example of getting all telephone numbers on a report that contain "Rod" in their lastname:
    Code:
    filt = "'Rod'$Lname"
    report.preview("Telephone List", filt)
    I'm trying to use it in the 'select records' expression builder within the report properties

    report.jpg

    Thanks for your help

  6. #6
    Member
    Real Name
    Andrew Davidowicz
    Join Date
    Aug 2018
    Location
    New Jersey
    Posts
    23

    Default Re: Filtering a report with 'Contains' function

    Put this exact code into the expression builder and show me what it says.

    Code:
    "12345"$Address1 .and. "201"$Address2 .and. completed = .f. .and. Done = .f.

  7. #7
    Member
    Real Name
    Mark Williams
    Join Date
    Dec 2005
    Posts
    318

    Default Re: Filtering a report with 'Contains' function

    Quote Originally Posted by Davidowicza View Post
    Put this exact code into the expression builder and show me what it says.

    Code:
    "12345"$Address1 .and. "201"$Address2 .and. completed = .f. .and. Done = .f.
    Andrew,

    This works perfectly - thanks!

    I'm not sure why I couldn't get it to work the first time but assume it was my fat finger syndrome.

    I appreciate your help

  8. #8
    Member
    Real Name
    Andrew Davidowicz
    Join Date
    Aug 2018
    Location
    New Jersey
    Posts
    23

    Default Re: Filtering a report with 'Contains' function

    Mark,

    Haha, glad it's working out!

Similar Threads

  1. Report Filtering Help
    By Playball335 in forum Alpha Five Version 8
    Replies: 10
    Last Post: 05-14-2008, 12:43 PM
  2. Filtering Report
    By Phil Rolf in forum Web Application Server v7
    Replies: 11
    Last Post: 11-23-2006, 04:37 PM
  3. Need help with report filtering
    By Gary Phillips in forum Alpha Five Version 5
    Replies: 5
    Last Post: 06-22-2004, 02:32 PM
  4. filtering on a group total function
    By WillieLucas in forum Alpha Five Version 5
    Replies: 1
    Last Post: 05-08-2003, 12:11 PM
  5. Filtering using the total function
    By WillieLucas in forum Alpha Five Version 4
    Replies: 3
    Last Post: 03-28-2002, 03:23 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •