Set field value in record if MAX

Joined
Sep 27, 2005
Messages
6
Reaction score
0
I am using the following query to show the Max values in a query, which works well. What I really need to do though, is to show all of the records, but to create and set a field to 1 if it is the NPIEC is Max. I have searched the postings with no luck. I don't want to update a table, I'd just like to update the query. Any suggestions would be much appreciated. Thanks.

SELECT SASNoDemout.MODEL, SASNoDemout.TOPLEVEL, SASNoDemout.PARTA, SASNoDemout.PARTB, SASNoDemout.PT, Max(SASNoDemout.NPIEC) AS MaxOfNPIEC
FROM SASNoDemout
WHERE (((SASNoDemout.DemoutZero)<>"1"))
GROUP BY SASNoDemout.MODEL, SASNoDemout.TOPLEVEL, SASNoDemout.PARTA, SASNoDemout.PARTB, SASNoDemout.PT
ORDER BY SASNoDemout.MODEL, SASNoDemout.TOPLEVEL, SASNoDemout.PARTA, SASNoDemout.PARTB;
 

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

Similar Threads


Top