Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2009
    Posts
    7

    Unanswered: hi every one this is my first question

    hello every one
    i am new here and i have a question
    i have table like this

    PR_NO CHANG_DAT APPR_PER APPR_DAT
    6 01/07/2009 8 31/03/2009
    6 01/07/2008 8 31/03/2008
    6 01/07/2007 8 31/03/2007
    6 01/07/2006 10 31/03/2006
    6 01/07/2005 10 31/03/2005

    i want to get the recored on the row that max(chang_dat)
    when i make grouping and select max chang_dat it gives me many recoreds i want only the record on the max(chang_dat) which is
    6 01/07/2009 8 31/03/2009


    the sql which i write is

    SELECT SAL_H.PR_NO, Max(SAL_H.CHANG_DAT) AS MaxOfCHANG_DAT, SAL_H.APPR_PER, SAL_H.APPR_DAT
    FROM SAL_H
    GROUP BY SAL_H.PR_NO, SAL_H.APPR_PER, SAL_H.APPR_DAT
    HAVING (((SAL_H.PR_NO)=6));

    but it give me many recoreds
    thank you for your help

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    This type of thing?

    Most recent value
    Paul

  3. #3
    Join Date
    Oct 2009
    Posts
    7
    thanks it work very good

Posting Permissions

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