Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2003
    Posts
    46

    Unanswered: Select Maximum Value

    Hi All,

    Wondering if anyone knows of an easy way to select a maximum value out of a number of fields within the same record (ie. In Excel you can use Max([FieldA],[FieldB],[FieldC]) ) To my knowledge there isn't a quick way (using If...Else statements at the moment) but just thought I'd ask around...?

    Cheers

    C

  2. #2
    Join Date
    Aug 2003
    Location
    Delft, The Netherlands (EU)
    Posts
    447

    Re: Select Maximum Value

    You may use the IIf function:

    IIf(Field1 > Field2, Field1, Field2)

    However, it becomes complex for more fields:

    IIf(Field3 > IIf(Field1 > Field2, Field1, Field2), Field3, IIf(Field1 > Field2, Field1, Field2))
    Make everything as simple as possible, but not simpler! - A. Einstein
    DB Problems? DB Explorer, BTrieve Re-engineering, DB Conversions & ETL? Conversion Tool

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •