B
BlueWolverine
Hello,
MS ACCESS 2003 on XP PRO.
I have a question on group by queries.
I have a table that for testing has 14 entries.
It's the same ID number (on purpose) but it stores records for 7 days of the
week, times 2 codes on the ID.
Consequently, my table looks like this
ID DotW Code
1 M H06
1 T H06
1 W H06
1 Th H06
1 F H06
1 S H06
1 Su H06
1 M H07
1 T H07
1 W H07
1 Th H07
1 F H07
1 S H07
1 Su H07
I want to group by this thing into a table that looks like this
ID Count of DotW Count of Code
1 7 2
Right now the results of the counting query look like this.
ID Count of DotW Count of Code
1 14 14
Ideas?
Thanks.
SQL For the query (save the where clause which is long and perfect.)
SELECT q_DOW_ML.ID, Count(q_DOW_ML.Fleet_Activity) AS CountOfFleet_Activity,
Count(q_DOW_ML.DayOfWeek) AS CountOfDayOfWeek, q_DOW_ML.BinstoOther,
Count(q_CCC_VFG_VRT.t_CCCMAP_Unique.CCC) AS CountOfCCC,
Count(q_CCC_VFG_VRT.VFG) AS CountOfVFG, Count(q_CCC_VFG_VRT.VRT) AS
CountOfVRT, q_DOW_ML.[GQRS CAT], q_DOW_ML.ACTION, q_DOW_ML.[Work Element
Description], q_DOW_ML.Frequency, q_DOW_ML.[WES#], q_DOW_ML.Source,
q_DOW_ML.Active
FROM q_CCC_VFG_VRT INNER JOIN q_DOW_ML ON q_CCC_VFG_VRT.ID = q_DOW_ML.ID
<<<WHERE CLAUSE>>>
GROUP BY q_DOW_ML.ID, q_DOW_ML.BinstoOther, q_DOW_ML.[GQRS CAT],
q_DOW_ML.ACTION, q_DOW_ML.[Work Element Description], q_DOW_ML.Frequency,
q_DOW_ML.[WES#], q_DOW_ML.Source, q_DOW_ML.Active
ORDER BY q_DOW_ML.ID;
Thank you.!
MS ACCESS 2003 on XP PRO.
I have a question on group by queries.
I have a table that for testing has 14 entries.
It's the same ID number (on purpose) but it stores records for 7 days of the
week, times 2 codes on the ID.
Consequently, my table looks like this
ID DotW Code
1 M H06
1 T H06
1 W H06
1 Th H06
1 F H06
1 S H06
1 Su H06
1 M H07
1 T H07
1 W H07
1 Th H07
1 F H07
1 S H07
1 Su H07
I want to group by this thing into a table that looks like this
ID Count of DotW Count of Code
1 7 2
Right now the results of the counting query look like this.
ID Count of DotW Count of Code
1 14 14
Ideas?
Thanks.
SQL For the query (save the where clause which is long and perfect.)
SELECT q_DOW_ML.ID, Count(q_DOW_ML.Fleet_Activity) AS CountOfFleet_Activity,
Count(q_DOW_ML.DayOfWeek) AS CountOfDayOfWeek, q_DOW_ML.BinstoOther,
Count(q_CCC_VFG_VRT.t_CCCMAP_Unique.CCC) AS CountOfCCC,
Count(q_CCC_VFG_VRT.VFG) AS CountOfVFG, Count(q_CCC_VFG_VRT.VRT) AS
CountOfVRT, q_DOW_ML.[GQRS CAT], q_DOW_ML.ACTION, q_DOW_ML.[Work Element
Description], q_DOW_ML.Frequency, q_DOW_ML.[WES#], q_DOW_ML.Source,
q_DOW_ML.Active
FROM q_CCC_VFG_VRT INNER JOIN q_DOW_ML ON q_CCC_VFG_VRT.ID = q_DOW_ML.ID
<<<WHERE CLAUSE>>>
GROUP BY q_DOW_ML.ID, q_DOW_ML.BinstoOther, q_DOW_ML.[GQRS CAT],
q_DOW_ML.ACTION, q_DOW_ML.[Work Element Description], q_DOW_ML.Frequency,
q_DOW_ML.[WES#], q_DOW_ML.Source, q_DOW_ML.Active
ORDER BY q_DOW_ML.ID;
Thank you.!