views:

229

answers:

2

Can someone explain to me how VBA for Access could ship without a simple Max(x,y) Function?

I know it can be done: IIf(x > y, x,y) but really... why?

+1  A: 

Because they probably thought that you would use DMAX and DMIN or the sql MAX and only working with the database in access?

Im also curious about why.. Its seems like a overkill to have to create a temp-table and add form values to the table and then run a DMAX or MAX-query on the table to get the result...

Stefan
yeah, and the values I am using are in the database, but in two columns of the same row. It's just not an aggregate Max, but a simple mathematical Max.
DGM
+1  A: 

I've been known to create a small projMax() function just to deal with these. Not that VBA will probably ever be enhanced, but just in case they ever do add a proper Max (and Min) function, it won't conflict with my functions. BTW, the original poster suggests doing IIF... That works, but in my function, I usually throw a couple of Nz()'s to prevent a null from ruining the function.

Knox