Hi expert,
When i try this script i got 2 esn number with different shipdate and supplierid.
were us it should be the latest shipdate should be obtain.
Any Idea guys. thanks.
TABLE1
ESN
123
TABLE2
ESN--SupplierID--Shipdate
123--40----------2011-04-27
123--14----------2011-07-02
Select
vp.esn,
us.supplierid,
us.shipdate
--(Select Max(shipdate) from TABLE2 where vp.esn = us.esn)
From Table1 as vp with (nolock)
Left Outer Join TABLE2 as us with (nolock)
On vp.esn = us.esn COLLATE Chinese_Taiwan_Stroke_CI_AS
and us.shipdate ?
--and Max(Shipdate)
Where vp.ReceivingPO is not null
and vp.Receiveddate is not null
and vp.esn <> 'ESN' and vp.ESN <> 'TLCSHK'
Regards,
Jov