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

Selecting only "finished" groups

Selecting only "finished" groups

(OP)
OK, let's say that I have a table with 5 columns: ID, Name, ProviderId, Date, Amount

Now, let's say that I fill in 4 of the fields and the client has to fill in the fifth field (in this case, ProviderId)

Is there a nice way to ONLY select the Name (they will be grouped by name and date) for those that have filled in ProviderId for ALL records for a given day?

CODE

1, Joe, 123, 3/6/2017, 20
2, Joe, 234, 3/6/2017, 38
3, Joe, , 3/6/2017, 25
4, Jill, 156, 3/6/2017, 40
5, Jill, 321, 3/6/2017, 12 

So, I want to select Jill because she did her job and has given me the ProviderId for her transactions, but not Joe, because he did not finish all of them.

Thanks,
Willie

RE: Selecting only "finished" groups

Untested:

CODE

SELECT Name, Date FROM yourtable GROUP BY Name, Date Having COUNT(*)=COUNT(ProviderID) 

Bye, Olaf.

RE: Selecting only "finished" groups

(OP)
Hmm... Thx, I'll give it a shot

RE: Selecting only "finished" groups

I'm pretty sure it works, it just depends on the gaps being NULL values. An empty field is something COUNT(field) will count, too.

Bye, Olaf.

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