Question:
How do I stop MS Access from adding the "MaxOf" prefix to aggregate fields in queries?
K C
2008-10-23 08:34:14 UTC
When you set a field in an MS Access query to aggregate via one of the built in functions (Min, Max, etc.), Access changes the name of the field by prepending a "MinOf" or "MaxOf" prefix in the resultant data set. I want to know how to disable this feature and have Access pass the name of my source field without modification.
Three answers:
Nobody
2008-10-23 08:38:37 UTC
Don't let access attempt to "design and write" your queries for you. Whenever you create a query, right click in the white area where you would add tables, and click...I think it's called SQL view or SQL designer...or query design mode...or something similar, and write your own SQL queries.
2008-10-23 08:41:00 UTC
Well, I am not sure about how to do it in the GUI (I can't stand the GUI, or 'designer' view in Access) but I know you could view and modify the SQL, and put your own name in after the 'AS' keyword, something like :



SELECT MAX(salary) AS Salary

FROM yourTable



That's what I would do. Good luck : )
mmarrero
2008-10-23 09:07:14 UTC
On the GUI, use a new name then a colon, for example, myName:Field1. You can even type "Field1:Field1". In SQL code you'll see "Field1 AS Field1".



(I don't know why most people prefer typing SQL code. In VBA you can invoke GUI queries and add parameters. Open a querydef, add parameters, then open the queryset's recordset. Fortunately in .NET there's now LINQ)


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...