• I'm not sure if what you're asking for is "max" and "min". Take a look at those in Books Online and see if they will do what you need.

    If you want to return the higher of two values in two different columns, I think a Case statement is needed.

    case

    when Col1 => Col2 then Col1

    when Col2 > Col1 then Col2

    else null

    end

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon