Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date question

Status
Not open for further replies.

jomarelectric

IS-IT--Management
Jan 19, 2007
36
CA
crxi

hello, all.

my data:

product receive_date purchase_price

i'm querying PO's for most recent purchase pricing. my thing is, it brings in data from as far back as 1995 (too much data, man). what i need is...say, the 3 most recent purchases.

thanks in advance for any help offered.

//frank
 
Why not limit the records to those in recent years in the record selection formula?

If you really want only the last three dates per customer (I'm guessing that this might be what you mean), then you could set up a command something like the following, depending upon your datasource:

Select table.`date`, table.`custID`
From table
where table.`date` in
(
select top3 A.`date`
from table A
where A.`custID` = table.`custID`
order by A.`date` desc
)

-LB
 

they're actually wire purchases (prices fluctuate often) from suppliers.

so, i'll just substitute po_ID for your custID and that should do it.

the last three purchases is exactly what we're looking for (for price a comparison). as always, LB your help is so appreciated.

take care,

//frank
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top