Programming noob
Programming noob

Reputation: 17

Query to group data in MS Access

I have a table in MS Access:

ID        | Holiday
----------+------------------
1234      | 1
1234      | 2
2345      | 5
2345      | 6

I would like create a query to sum the Holiday for each duplicate IDs.

I would like to make my query result like this:

ID        | Holiday
----------+------------------
1234      | 3
2345      | 11

Any ideas on how to do this would be greatly appreciated.

Perhaps using SQL in MS Access ? Good day people.

Upvotes: 0

Views: 34

Answers (1)

zealous
zealous

Reputation: 7503

Try the following, you just need to use sum and group by

select
    id,
    sum(holiday) as holiday
from yourTable
group by
    id

Upvotes: 2

Related Questions