There is a way to get the entire thing done in a single SQL statement. However, it is anything but simple and may not be as dynamic as if you used a form to retrieve the data. I am referring to dynamically updating the recordset or the data retrieved.
Consider the following SQL:
Code:
SELECT Last(RSVP.GuestID) AS LastOne, Min(RSVP.AutoNum) AS MinNum
FROM RSVP;
This will retrieve two unrelated records in a single row of a recordset. It employs two functions and assigns them to an alias, ie AS MinNum
An alias will be displayed as a field name.
As soon as I add another field that is not an alias, the Last() function and the Min() function will not work together. I will get an aggregate function error. This is what I was eluding to earlier about grouping with alias', and it is still rather complex.
You can create an SQL statement that uses functions and alias’ across the board. If you add a field straight from a table without using a function, you will get an error. If you can get creative and build functions (across the board) to return the data you need, the SQL will work.
Clear as mud?