Combine two rows

Grunners

Registered User.
Local time
Today, 20:31
Joined
Jun 25, 2002
Messages
59
Hi there,

This can't be too difficult but it's taken me a day to realise that I'd just have to post.

I have a table:

ID (PK)
member (Integer)
Hours (Integer)

eg:

1 - 200 - 12
2 - 201 - 24
3 - 202 - 26
4 - 202 - 2

I'd now like a table in the same format but with the rows where the member number is equal to be combined so the above would become like so:

1 - 200 - 12
2 - 201 - 24
3 - 202 - 28

I'd rather do it in code than queries as it's always seemed more reliable to me.

Any comments would be much appreciated...:(
 
Use a totals query, group on memberID and Sum on hours. You don't need to store the results in a new table, unless you need to. You can just use the query.
 
Thanks guys,

I should have gone in to more detail with respect to this being part of a much larger project. However! I'm in no position to argue and so will take your advice and try to accomplish at least this bit via the query route.

Thank you again
Grunners
 

Users who are viewing this thread

Back
Top Bottom