473,503 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Query Function? Max of options

47 New Member
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
5 1339
ChipR
1,287 Recognized Expert Top Contributor
Unless you prefer to write your own comparison function, it doesn't get much easier than iif.
Apr 14 '09 #2
dantebothermy
47 New Member
I'm sorry to hear that. But thanks
Apr 14 '09 #3
Whizzo
44 New Member
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
Whizzo
44 New Member
Scratch that,
Expand|Select|Wrap|Line Numbers
  1. IIf([PolicySumAssuredLife1]>[PolicySumAssuredLife2],[PolicySumAssuredLife1],[PolicySumAssuredLife2])
seems to hold water. All solved!
Apr 15 '09 #5
NeoPa
32,557 Recognized Expert Moderator MVP
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

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

Similar topics

22
3006
by: Robert Brown | last post by:
suppose I have the following table: CREATE TABLE (int level, color varchar, length int, width int, height int) It has the following rows 1, "RED", 8, 10, 12 2, NULL, NULL, NULL, 20...
4
4643
by: Pasquale | last post by:
Hello, I wondering if there is a way to dynamically update a select list with javascript from a database query without having to reload the page to update the list?
15
5625
by: Rolan | last post by:
There must be a way to enhance the performance of a query, or find a plausible workaround, but I seem to be hitting a wall. I have tried a few tweaks, however, there has been no improvement. ...
4
1768
by: Geoff | last post by:
I need to produce a report based on a query. Cost is a calculated field and its value is dependent on another field, in the query, called Session. There are 5 different Session codes each...
7
3679
by: BillCo | last post by:
taking the following data: a w a n b r b y b p c a getting the following result from a query:
1
2544
by: traceable1 | last post by:
I have 2 SQL databases which are the same and are giving me different query plans. select s.* from hlresults h inner join specimens s on s.specimen_tk = h.specimen_tk where s.site_tk = 9 and...
36
2989
by: Liam.M | last post by:
hey guys, I have one last problem to fix, and then my database is essentially done...I would therefore very much appreciate any assistance anyone would be able to provide me with. Currently I...
4
1762
by: icony | last post by:
Hi everyone, I have this slq code slqtext = "SELECT . From total_installs, uachoisi WHERE (((.)='*afe*'));" which makes a query that only accept values containing "afe". It works perfectly.
0
3282
by: phlype.johnson | last post by:
I'm struggling to find the best query from performance point of view and readability for a normalized DB design. To illustrate better my question on whether normalized designs lead to more complex...
5
3329
Jerry911
by: Jerry911 | last post by:
Hi, I have a query that I use to export data to a spreadsheet. The query itself works fine and I can manually edit the query to supply filtered information. What I would like to do is use a form...
0
7202
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7084
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
6991
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7458
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1512
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
380
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.