How do you return 1 value per row of the max of several columns:
TableName
[Number, Date1, Date2, Date3, Cost]
I need to return something like this:
[Number, Most_Recent_Date, Cost]
Query?
How do you return 1 value per row of the max of several columns:
TableName
[Number, Date1, Date2, Date3, Cost]
I need to return something like this:
[Number, Most_Recent_Date, Cost]
Query?
Well, you can use the CASE statement:
[For Microsoft SQL Server 2008 and above, you may consider Sven's simpler answer below.]
I do not know if it is on SQL, etc... on M$ACCESS help there is a function called
MAXA(Value1;Value2;...)
that is supposed to do such.Hope can help someone.
P.D.: Values can be columns or calculated ones, etc.