RE: How to compare fields

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Sure...

SELECT
Max(IIf(IIf([POSEN1]>[POSEN2],[POSEN1],[POSEN2])<[POSEN3],[POSEN3],IIf([POSEN1]>[POSEN2],[POSEN2],[POSEN1]))) AS POS_MAX
FROM HIPlanNames;

the test values were posen1=50000, posen2=20000, posen3=21562

"Ofer" wrote:

> I would like to know the answer to this question also, if you'll get no
> better answer, try this
>
> IIF(IIF(Field1>Field2,Field1,Field2)<Field3,Field3,IIF(Field1>Field2,Field1,Field2)))
>
> --
> I hope that helped
> Good luck
>
>
> "Luther" wrote:
>
> > Hi,
> >
> > I need to compare three numeric fields and pick the greater of the three; I
> > will then have to use that number in subsequent calculations.
> >
> > Any help with this will be greatly appreciated.
> >
> > Thanks.
.



Relevant Pages

  • RE: How to compare fields
    ... "Ofer" wrote: ... >> I need to compare three numeric fields and pick the greater of the three; ... >> will then have to use that number in subsequent calculations. ... Prev by Date: ...
    (microsoft.public.access.queries)
  • RE: Help Please Combo Box Used to Select a Report
    ... I had given the wrong name to the combo box in my first posting, ... I still can't figure out how the code should work Ofer. ... >> I have checked the report name and it is definately correct. ... Prev by Date: ...
    (microsoft.public.access.gettingstarted)
  • RE: "Runtime Error 2110" cannot move the focus to the control
    ... "Ofer" wrote: ... >> I have the subform is set correctly but I am trying to set.focus to the main ... >>> Check if the enable property of the field you want to move the focus to is ... Prev by Date: ...
    (microsoft.public.access.formscoding)
  • RE: table variable lookup
    ... "Ofer" wrote: ... > You can create a query that include all the fields from ... > function GetVar() ... Prev by Date: ...
    (microsoft.public.access.gettingstarted)
  • Re: Basic Question- "IIF/Like"
    ... Thanks Rick and Ofer! ... I guess the problem was with my IIf stmt! ... working like a champ now! ... Prev by Date: ...
    (microsoft.public.access.queries)