Dear All

I have one problem, data and output I want as per below
description. What query should I need to write ?

CODE DATE QTY TIME
A 02/02/2008 5 10:30
A 05/02/2008 1 11:30
A 06/02/2008 2 07:30

B 01/02/2008 4 09:30
B 03/02/2008 2 02:30
B 02/02/2008 1 12:30


OUTPUT

CODE DATE QTY TIME

A 06/02/2008 2 07:30
B 03/02/2008 2 02:30


i.e. QTY and TIME OF MAX DATE

Thanks in Advance

Re: VFP Query Solution by Anders

Anders
Thu Mar 06 06:38:43 CST 2008

SELECT * FROM Table AS T1 WHERE date = ;
(SELECT MAX(date) FROM Table AS T2 ;
WHERE T1.code=T2.code) ;
INTO CURSOR Maxdates

-Anders


"Vp" <vishnu.baroda@gmail.com> wrote in message
news:6de79e84-872f-425e-9eb3-82c3cf6cf569@d62g2000hsf.googlegroups.com...
> Dear All
>
> I have one problem, data and output I want as per below
> description. What query should I need to write ?
>
> CODE DATE QTY TIME
> A 02/02/2008 5 10:30
> A 05/02/2008 1 11:30
> A 06/02/2008 2 07:30
>
> B 01/02/2008 4 09:30
> B 03/02/2008 2 02:30
> B 02/02/2008 1 12:30
>
>
> OUTPUT
>
> CODE DATE QTY TIME
>
> A 06/02/2008 2 07:30
> B 03/02/2008 2 02:30
>
>
> i.e. QTY and TIME OF MAX DATE
>
> Thanks in Advance