Skip to Content

Display only one record in Crystal Reports

Hello,

I am trying to display only one record that meet certain criteria (the same date, the same type but different color) but I am getting an error.

For example, two Hondas cars (the same type) were sold on the same date but I need to be able to display only row for Red color:

DATE………………………….CAR TYPE……………………COLOR

20/07/2017………………..HONDA………………………..WHITE

20/07/2017…………………..HONDA……………………….RED

I need to be able to see only

20/07/2017…………………..HONDA…………………….RED

Thanks a lot

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Aug 10, 2017 at 07:36 AM

    Group data on Date and Car Type

    Suppress Group Headers, details and date group footer.

    Move fields to Car type footer

    Ian

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 10, 2017 at 07:44 AM

    Hi Alisia,

    1. Create a formula called @group with this code:

    {Date field} & {Car Type Field}

    2. Insert a Group on this formula field

    3. Place the Date and Car Type fields on the Group Header/Footer

    4. Create a formula called @Color with this code:

    If {Color Field} = 'RED' then 'RED'

    5. Go to the Insert Summary Option > Insert a Summary on the @Color formula > Choose 'Maximum' as the sum function and place this summary field on the Group Header or Footer beside the other fields.

    Do note that this will only show the color when a row has a RED car.

    If for e.g. on a particular day only one White car was sold, the field will show blank as it's only looking for Red cars.

    -Abhilash

    Add comment
    10|10000 characters needed characters exceeded

    • Thank you Abhilash very much for your help on this. I need to be able to see white or other car colors if they were sold on the other days and other care type if they were sold on the same date . I just need to display Red if this is the same date and type. Also, I need to summarize this data in crosstab. I hope this is possible. Please let me know if additional clarification is required. Thanks again!