Skip to Content
0
Jun 21, 2019 at 01:53 PM

MAX Function not working as expected

70 Views

Hello,

I've written the following query, but it shows all dates rather than only the latest

SELECT T0."ItemCode", Max(T0."FromDate"), T0."Price" FROM SPP1 T0 WHERE T0."ListNum" = '2' and T0."ItemCode" = 'ABC' GROUP BY T0."ItemCode", T0."Price"

I only want to see the row with the latest date, but the results are as follows:

Item Number - MAX(FromDate) - Price

ABC 05/01/19 4.92

ABC 11/01/18 4.76

ABC 02/01/19 4.53