Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2004
    Posts
    3

    Unanswered: Max Dates For Cost

    Hi,

    I am trying to identify the costs for products with the latest cost date. I am unable to run the query. Is there something that I can do?

    SELECT PART,COST, DATE FROM DATA/COSTFILE AS T1 WHERE T1.DATE= (SELECT MAX(DATE) AS T2 FROM DATA/COSTFILE AS T2 WHERE T2.PART=T1.PART)

    Thanks,

    David

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    SELECT PART, COST, DATE
    FROM COSTFILE T1
    WHERE T1.DATE =
    (SELECT MAX(DATE) FROM COSTFILE T2 WHERE T2.PART = T1.PART)
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •