This is a aingle table, simple query problem, I think. I am prepared to feel and look stupid with your response, any response, and any good Access/VBA/Sql resources online you can recommend will be greatly appreciated!
Within one table, there are two columns I need to report on.
tblRecords
Badge , Type
0001 , Call In
0001 , Call Out
0002 , Call In
0002 , Call In
0002 , Call Out
0003 , Call Out
0003 , Call Out
What I am needing is something like this
Badge , Call In , Call Out
0001 , 1 , 1
0002 , 2 , 0
0003 , 0 , 3
I've tried the following:
SELECT Badge, count(Type = "Call In") as CallIn, count(Type = "Call Out") as CallOut
from tblRecords
Group by Badge;
and
SELECT Badge, (SELECT count(*) from tblRecords where Type = "Call In") as CallIn, (SELECT count(*) from tblRecords where Type = "Call Out")as CallOut
from tblRecords
Group by Badge;
and all I can get is something like this:
Badge , CallIn , CallOut
0001 , 2 , 2
0002 , 3 , 3
0003 , 2 , 2
To say the truth, I've tried 50 ways and dozens of Google searches and still haven't found the simple answer.
Thank you
Within one table, there are two columns I need to report on.
tblRecords
Badge , Type
0001 , Call In
0001 , Call Out
0002 , Call In
0002 , Call In
0002 , Call Out
0003 , Call Out
0003 , Call Out
What I am needing is something like this
Badge , Call In , Call Out
0001 , 1 , 1
0002 , 2 , 0
0003 , 0 , 3
I've tried the following:
SELECT Badge, count(Type = "Call In") as CallIn, count(Type = "Call Out") as CallOut
from tblRecords
Group by Badge;
and
SELECT Badge, (SELECT count(*) from tblRecords where Type = "Call In") as CallIn, (SELECT count(*) from tblRecords where Type = "Call Out")as CallOut
from tblRecords
Group by Badge;
and all I can get is something like this:
Badge , CallIn , CallOut
0001 , 2 , 2
0002 , 3 , 3
0003 , 2 , 2
To say the truth, I've tried 50 ways and dozens of Google searches and still haven't found the simple answer.
Thank you