Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2006

    Unanswered: How to exclude records from a Crystal report

    I am trying to retreive certain records from a report and exlude
    I want all records that have visit our office in a year period and did
    not have a TEST
    1111 11/10/2005 Consult
    12/25/2005 Exam
    10/02/2005 Test

    2222 09/10/2005 Exam
    10,12/2005 Consult

    But when I used the record selection tab in Crystal to select the
    SERVICE ID not equal to TEST it's still showing the same two records
    1111 without TEST and 2222, it only exlude the row from the record. I
    would like to exclude all the Person ID who''ve had a TEST so I can
    Identify the person who didn't have a TESTand had date of service in
    that year.
    How can I do this?
    Thank you

  2. #2
    Join Date
    Jan 2006
    You need to create a flag and use a group selection... let me explain!

    Firstly, in your Record Selection make sure you are only selecting visits this year:

    {DATE OF SERVICE} >= today - 365

    Then create a formula field called "Test" in your details section, something along the lines of...

    if {SERVICE ID} = "Test" then 1 else 0

    Group your report by {PERSON ID} and insert a sum of "Test" into the group footer. You can probably see where I'm heading now, but the last step is to go to the Group Selection formula (in the Report Menu - Selection Formulas - Group) and use the summary to select the groups e.g.

    Sum({@Test}, {PERSON ID}) < 1

    This looks worse than it is... Just double click the summaries in the report fields pane and it will do most of that hard typing for you!

    What Crystal actually does is grab all of the data with visits this year (you'll see all the Person IDs in the group tree) but it only displays the groups where that "Test" flag totals less than 1 (i.e. they ain't had a test!)

    Nifty eh?


  3. #3
    Join Date
    Feb 2006

    Crystal report

    Hi StuartB,
    Thank you so much for your help, it WORKS!!!! you saved the day.
    Thanks again


Posting Permissions

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