Count Rows query

Steve in Atlanta

New Member
Joined
Jun 16, 2004
Messages
31
Please help! I'm trying to write a query that will count the unique occurances of employee ID's on two linked tables (DB2 tables). I have a table that records the country (US or Canada) and employee ID every time the employee logs on to our system. (I'm using the second table to limit the data) What I want to do is count the number of different employees, subtotaled by country, that logged on on a given day. The output would look like:

US 350
Can 75
Total 425

Which would indicate that on the day in question 350 different US employees and 75 different Canadian employees logged on. In design view when I add "Count" under employee ID I get an "ODBC - Call Failed" error. If it's easier to do this with a report that would be fine too.

Thanks
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Right click and select totals to get counts and grouping.
 
Upvote 0
When I do that I get an 'ODBC - call failed' error as follows:

[IBM][CLI Driver][DB2] SQL0111N The column function "" does not include a column name. SQLSTATE=42901 (#-111)

I have the employee ID column set to 'Count' and the other three columns set to 'Group By'. I have two of the columns set not to display. The two that I am displaying are the Country code and employee ID
 
Upvote 0

Forum statistics

Threads
1,221,773
Messages
6,161,855
Members
451,724
Latest member
sledparty

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top