Ivor Williams said:
Chris...
It appears that your solution may be what I'm looking for, but I don't
understand what parts of it need to go where.
Can you please explain in more detail, I'm not too bright you know.
Ivor
Ivor Williams,
It depends on what your table structures are.
You need to adapt the SQL example given to your situation by
changing the example table and column names in the query to your
table and column names.
I do not know what your table and column names are, so I cannot tell
you what that will be.
Once all the appropriate name changes have been made, open a new
query in Design View, change to SQL View (go to the menus, View >
SQL View), and copy and paste the adapted SQL code into the SQL
window. Then execute the query to see if what I have posted will
actually work for you (it might not).
Note: UNION queries, I believe, cannot be represented in Design
View, so don't try and switch back to Design View in this particular
case.
My example:
SELECT (SELECT COUNT(E03.TestValue)
FROM (SELECT E001.TestValue
FROM ExamAscKeyOne AS E001
UNION
SELECT E002.TestValue
FROM ExamAscKeyTwo AS E002) AS E03
WHERE E03.TestValue <= E1.TestValue)
AS NewAscCol
,E1.TestValue
FROM (SELECT E01.TestValue
FROM ExamAscKeyOne AS E01
UNION
SELECT E02.TestValue
FROM ExamAscKeyTwo AS E02) AS E1
ExamAscKeyOne > Gets changed to your first table name.
ExamAscKeyTwo > Gets changed to your second table name.
"AS NewAscCol" > Gets changed to whatever you want the new ascending
sequential value column to be named.
TestValue > Gets changed to whatever is the column name that you
want the new ascending sequential value to be "based on". (Note,
the UNION subqueries are set to eliminate duplicates.)
You can leave the table aliases alone, and it will still work (but I
would probably change the lettering to more closely match your table
names; "E" is for "Exam" in the table names, in this case).
Sincerely,
Chris O.