D
Darrel
I'm trying to create a query from 2 joined tables.
EMP & Quizzes are joined on EMP_ID
In the results, I'd like to have one row for each employee with a column
showing their store, ID, name, and hire date (from the EMP table) and then a
column for each quiz date and quiz score for each quiz number. The Quizzes
table has a field for quiz number (b01 - b05), date taken, and score. It
should come out something like this:
STORE EMP_ID NAME Hire Date b01 Date b01 Score b02 Date b02 Score b03
Date b03 Score b04 Date b04 Score b05 Date b05 Score
3 84 JOE TEST 1/16/2009 12/22/2009 10:30:28 AM 80.00% 12/21/2009 11:58:24
AM 93.33% 12/28/2009 4:45:33 PM 93% 3/9/2009 4:50:16 PM 80% 1/27/2010 8:18:20
AM 93% 12/22/2009 11:20:56 AM 87%
3 90 JANE DOE Account Rep 1/6/2010 1/12/2010 1:40:31 PM 73.33% 1/7/2010
11:00:05 AM 93.33% 1/7/2010 11:19:05 AM 100% 1/7/2010 12:16:02 PM 93%
(sorry for the lost table format)
I can generate all of the data using expressions for each quiz date and
score, but it creates a seperate line for each one (if an employee took all 5
quizzes, there would be 5 lines).
I've tried grouping, select distinct, and select distinctrow to no avail. In
the past I've just used the grouping and changed the expressions to
"expression" instead of group by, and that worked fine, but in this instance,
i get the error "You tried to execute a query that does not include the
specified expression....as part of an aggregate function." The expression I
built looks like this:
Expr2: IIf([Quizzes]![quizid]="b01",[Quizzes]![date],"")
Expr3: IIf([Quizzes]![quizid]="b01",[Quizzes]![score],"")
I'm sure someone out there probably knows a better way.
thanks,
D
EMP & Quizzes are joined on EMP_ID
In the results, I'd like to have one row for each employee with a column
showing their store, ID, name, and hire date (from the EMP table) and then a
column for each quiz date and quiz score for each quiz number. The Quizzes
table has a field for quiz number (b01 - b05), date taken, and score. It
should come out something like this:
STORE EMP_ID NAME Hire Date b01 Date b01 Score b02 Date b02 Score b03
Date b03 Score b04 Date b04 Score b05 Date b05 Score
3 84 JOE TEST 1/16/2009 12/22/2009 10:30:28 AM 80.00% 12/21/2009 11:58:24
AM 93.33% 12/28/2009 4:45:33 PM 93% 3/9/2009 4:50:16 PM 80% 1/27/2010 8:18:20
AM 93% 12/22/2009 11:20:56 AM 87%
3 90 JANE DOE Account Rep 1/6/2010 1/12/2010 1:40:31 PM 73.33% 1/7/2010
11:00:05 AM 93.33% 1/7/2010 11:19:05 AM 100% 1/7/2010 12:16:02 PM 93%
(sorry for the lost table format)
I can generate all of the data using expressions for each quiz date and
score, but it creates a seperate line for each one (if an employee took all 5
quizzes, there would be 5 lines).
I've tried grouping, select distinct, and select distinctrow to no avail. In
the past I've just used the grouping and changed the expressions to
"expression" instead of group by, and that worked fine, but in this instance,
i get the error "You tried to execute a query that does not include the
specified expression....as part of an aggregate function." The expression I
built looks like this:
Expr2: IIf([Quizzes]![quizid]="b01",[Quizzes]![date],"")
Expr3: IIf([Quizzes]![quizid]="b01",[Quizzes]![score],"")
I'm sure someone out there probably knows a better way.
thanks,
D