INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Filtering results based on a running total

Filtering results based on a running total

(OP)
Hi there,

I am reporting on a database that returns the membership cards that have given to users, where its possible that some users have had more than one membership card if they have lost the one they have been allocated. its also possible for users to have multiple cards of different types.

on my report have the following rows

from the users table : user id, username, start_date, department

from the cards table : card_id, activation_date, card_type, card_lost.

I have joined both tables on user id and am able to report on all the users and the cards allocated to them.

What i want to restrict my report so that it only returns those with more than one card.

I thought this would be simple to do by creating a running total and then using this field to only return rows where the count is > 1 but Crystal does not seem to support that. is there anyway else i can get this work?

RE: Filtering results based on a running total

Group on user ID and then go to report->selection formula->GROUP and enter:

Distinctcount({cards.cardID},{users.userID})>1

If you want to do any summaries across users, you will need to use running totals since non-selected records are still IN the report, just not displayed.

-LB

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close