Hi all
i have the table like this
12411 1 622 2016-03-14 00:00:00 730.24 ****
12411 1 622 2016-03-01 00:00:00 586.35
12411 1 622 2016-02-24 00:00:00 1554.22
12411 1 622 2016-02-22 00:00:00 1342.07
12411 1 622 2016-02-10 00:00:00 1316.59
12411 1 622 2016-02-02 00:00:00 767.92
12411 1 622 2016-01-19 00:00:00 1262.48
12442 1 650 2015-05-21 00:00:00 3607.50 *****
12442 1 650 2014-09-22 00:00:00 3069.60
12443 1 637 2015-07-30 00:00:00 268.32 *****
12447 1 668 2015-08-17 00:00:00 1046.08 ****
12447 1 668 2015-03-30 00:00:00 391.05
12447 1 668 2015-03-13 00:00:00 1358.28
this is a result set from
SELECT
cli_codigo
,cli1_Empresa
,cli1_vend
,dup_dtemissao
,dup_vlduplicata
FROM teste.dbo.Clientes
LEFT OUTER JOIN teste.dbo.duplicat D ON Clientes.cli_codigo = D.dup_codigo
LEFT OUTER JOIN teste.dbo.CLIENTES1 ON Clientes.cli_codigo = Clientes1.cli1_codigo
where
cli_codigo between 12411 and 13000
order by cli_codigo , dup_dtemissao desc
I would like to get the rows marked as "****" , that is
max(date) and his value not the max(value)
any help will appreciated
tks
Clages