Hello, I have two tables. One "header data" and one "data only".
Header table:
[ID] [DateTime] [Comment]
1 2014-01-08 20:10:26.767 Test running 1
2 2014-01-08 20:29:37.203 Test running 2
Data table:
[ID] [Header_ID] [Type]
1 1 'A'
2 1 'B'
3 1 'A'
4 1 'C'
5 2 'A'
6 2 'C'
7 2 'C'
I want to run a query that give me following results (how many times the [Type] field have value 'A','B' or 'C' for every "running".
[ID] [DateTime] [Comment] [CountA] [CountB] [CountC]
1 2014-01-08 20:10:26.767 Test running 1 2 1 1
2 2014-01-08 20:29:37.203 Test running 2 1 0 2
Open in new window