SQLTeam.com | Weblogs | Forums

MAX Function


#1

Does this function: MAX(SALE_DT) translate to "Last Sale Date" or something like that?

Just trying to understand how the MAX function applies to dates in queries.


#2

If the data type of SALE_DT is DATETIME, DATETIME2 or one of the other date/time types, MAX(SALE_DT) will give you the latest date.

If there is a group by clause in your query, you may get multiple rows, each corresponding to a unique value of the columns in the group by clause.