I'm sure I've seen an example of this on the forum, but couldn't locate it.
I have:
select ;
s.cardrecordid, ;
S.invoicenumber, ;
S.Date, ;
(S.totallines + S.totaltax) as invtotal, ;
S.Outstandingbalance ;
from sales as S ;
left outer join cards as C ;
on S.cardrecordid = C.cardrecordid ;
order by s.date desc ;
into cursor tmpsales readwrite
index on cardrecordid tag cardid
and I would like to select the 5 most recent sales from each customer. I believe a sub-select clause would do it - how should I change this code?
Regards
Mike
I have:
select ;
s.cardrecordid, ;
S.invoicenumber, ;
S.Date, ;
(S.totallines + S.totaltax) as invtotal, ;
S.Outstandingbalance ;
from sales as S ;
left outer join cards as C ;
on S.cardrecordid = C.cardrecordid ;
order by s.date desc ;
into cursor tmpsales readwrite
index on cardrecordid tag cardid
and I would like to select the 5 most recent sales from each customer. I believe a sub-select clause would do it - how should I change this code?
Regards
Mike