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!

Need help to generate an SQL report from Oracle

Status
Not open for further replies.

ronm0666

IS-IT--Management
Aug 12, 2001
1
US
I am new at SQL and I need a formula. I am trying to get a part cost data report. The problem is that the system holds all the entry dates and part numbers EVERY time the part costs change. Therefore, the entry dates and part #'s are listed many times for each time the costs changes. What I need is the LAST entry date per part and that will give me the latest cost for those parts. NOTE: The last entry dates for the parts are not the same (some are & some aren't). Here are the columns: Entry Date (ENT_DAT), Part Number (PT_NO) and Part Cost (PT_COST). The daytabase name is KDL0016.

Thank You
 
Try using the Oracle max function on the ENT_DAT field eg :-

select max(ent_dat) ,pt_no, pt_cost
from ent_table
group by pt_no, pt_cost


I think this should do the trick for you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top