Max (filed1, filed2, filed3) in Access2003

  • Thread starter Thread starter Manny
  • Start date Start date
M

Manny

I Apparently Access does not have afunction that returns Max(filed1,
field2, filed3). I searched web I found a code (I don't know if it
works), If this a Module( say called Module1), how and where Do I call
that Module1 ? please show steps. Is there any better/easier way to get
this Max result? Thaks a lot.......
 
You should copy the code into a module and save it - the module must have a
name different from the function. The function would presumably have a name
such as FgetAverage.

In the query, you would have a calculated field
Field: AverageValue: fGetAverage([field1],[Field2],[Field3])

The best way to handle this in a relational database is probably to
restructure your tables so you have a record for each the current fields you
now have and then use the SQL aggregate function which works of the values
of one field in multiple rows. Table with fields something like:

PurchaseNumber (or whatever the different field titles currently represent)
Cost (whatever is stored in the current fields)

Then
 
Back
Top