Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getting a MAX field without using subquery

Status
Not open for further replies.

Crowley16

Technical User
Jan 21, 2004
6,931
GB
I would like to use a query in a report, which is something like:

select (select max(fld) from tbl) as maxFld, * from tbl

however I need to get rid of the subquery because this is used in the recordsource of a report with multiple level groupings.

Any ideas, on achieving the same thing without having to use that subquery?

Thanks

--------------------
Procrastinate Now!
 
the thing is, the query is already running really slow, so any way of doing this without useing any of the D stuff?

I was hopeing there's something to be done with fancy joins, but I'm not great at joins...

--------------------
Procrastinate Now!
 
that's what I'm hoping for

--------------------
Procrastinate Now!
 
I've worked it out...

basically, don't use a join, and store the value in a query somewhere...

like:

select QryMaxValue.Value, tbl.Flds
from QryMaxValue, tbl

easier than I thought... :)

--------------------
Procrastinate Now!
 
Technically, that IS a join. [smile]

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Technically, that IS a join
I'd say that is a cartesian product.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top