By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,222 Members | 1,610 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,222 IT Pros & Developers. It's quick & easy.

Query Function? Max of options

P: 47
I'm looking for a function that is similar to one in excel:

=max([field1],[field2])

I know I can write it using an iif statement, but I'm looking for an easier approach. Any ideas?

Thanks,


Dante
Apr 14 '09 #1
Share this Question
Share on Google+
5 Replies


Expert 100+
P: 1,287
Unless you prefer to write your own comparison function, it doesn't get much easier than iif.
Apr 14 '09 #2

P: 47
I'm sorry to hear that. But thanks
Apr 14 '09 #3

P: 44
What a coincidence, I've just hopped on here to find an answer for the exact same question! How is this done with IIF()? All I want is for the query to look at column1 and column2 and place the highest figure it finds in column3. As far as I can see IIF() can only compare A to B or B to A, not both. Any ideas?

Thanks!
Apr 15 '09 #4

P: 44
Scratch that,
Expand|Select|Wrap|Line Numbers
  1. IIf([PolicySumAssuredLife1]>[PolicySumAssuredLife2],[PolicySumAssuredLife1],[PolicySumAssuredLife2])
seems to hold water. All solved!
Apr 15 '09 #5

NeoPa
Expert Mod 15k+
P: 31,707
There's no function native to Access that provides this functionality.

You can write your own Public function if you like, otherwise make do with IIf().
Apr 15 '09 #6

Post your reply

Sign in to post your reply or Sign up for a free account.