MS Access/SQL

Discussion in 'Software' started by Mada_Milty, Oct 16, 2007.

  1. Mada_Milty

    Mada_Milty MajorGeek

    Good Day,

    I have a database table with data/structure similar to:

    ID-------------Date
    A-------------9/16/06
    A-------------5/12/07
    B-------------3/25/05
    C-------------12/05/05
    C-------------9/30/06
    C-------------2/2/07

    I would like to return a row for each record with the latest date. For example the query should return:

    A-5/12/07
    B-3/25/05
    C-2/2/07

    Can anyone advise on how to do this in MS Access and or SQL?

    Thanks,

    Milty
     
  2. Kodo

    Kodo SNATCHSQUATCH

    SELECT ID, Max([Date]) AS MaxOfDDate
    FROM Table1
    GROUP BY ID

    FYI: Bad idea to name a column "Date".. choose a different name because DATE is a reserved word. Err on the side of verbosity.
     
  3. Mada_Milty

    Mada_Milty MajorGeek

    Perfect! TYM, Kodo!
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds