"Constant" value in SELECT query?

J

jwkratz

I'm using Access XP in an attempt to do the following:

Display a listing of all student IDs, names, and ages. In addition t
these fields, each record should display the minimum age of the entir
class. That is, each record will display the same minimum age in
column.

For example:

ID.....Name.....Age.....MinAge
1......Jim......21......18
2......Bob......18......18
3......Jane.....22......18
4......Steve....25......18

I can select all the student records just fine, and I can run a quer
to select the minimum age of the entire class. I cannot, however, figu
out how to combine them.

I tried a join, but that resulted in an aggregate function error. Doe
anyone know if it is possible to repeat a "constant" value in a SELEC
statement?

Thanks your time
 
J

jwkratz

I actually received a solution to this problem that worked. I jus
nested the SELECT MIN query inside the main SELECT query. Worked like
charm
 
M

mikebres

Something like the following would work:

SELECT Table1.ID, Table1.Name, Table1.Age, (select min
(table1.age) from table1) AS MinAge
FROM Table1;

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top