
Signature
Jerry Whittle
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.
Thank you very much for your help. Here is the SQL statement and even with
SELECT DISTINCT I still get this extra row of the user first name and last
name as well as the blank Class 1 field.
SELECT DISTINCT Scores.LAST, Scores.FIRST,
IIf([QNUM]=30,IIf([Final]="Incorrect","Footnotes",Null),Null) AS Class1
FROM Scores INNER JOIN QnAllTable ON Scores.INDEX_NUM = QnAllTable.INDEX_NUM
GROUP BY Scores.LAST, Scores.FIRST, QnAllTable.QNUM, QnAllTable.FINAL
ORDER BY Scores.LAST;
> Like Doug said, show us the SQL! ;-)
>
[quoted text clipped - 19 lines]
> >
> > IIf([QNUM]=30 And [Final]="Incorrect","Footnotes","")
John Spencer - 12 Jan 2006 19:55 GMT
Well, Class 1 is probably the culprit, since it could calculate at FootNotes
in one case and Null in another case. Therefore, two records are returned.
Also, I wonder that the query (as posted) even ran, since you didn't group
by Class1. It's hard to say as I don't know which table or tables have the
fields QNUM and Final. By the way, I simplified the Class1 calculation.
What do you want to happen when two different values are calculated for
Class1?
SELECT DISTINCT Scores.LAST, Scores.FIRST,
IIf([QNUM]=30 AND [Final]="Incorrect","Footnotes",Null) AS Class1
FROM Scores INNER JOIN QnAllTable ON Scores.INDEX_NUM = QnAllTable.INDEX_NUM
GROUP BY Scores.LAST, Scores.FIRST, QnAllTable.QNUM, QnAllTable.FINAL,
IIf([QNUM]=30 AND [Final]="Incorrect","Footnotes",Null) AS Class1
ORDER BY Scores.LAST;
> Thank you very much for your help. Here is the SQL statement and even
> with
[quoted text clipped - 37 lines]
>> >
>> > IIf([QNUM]=30 And [Final]="Incorrect","Footnotes","")