Sql query to get the first and the last time + autobrand

  • ant6729

    Valued Member

    Points: 64

    Hello everyone!
    I have a query inside my attachment file 
    But it depicts only a part of my issue...
    I try to get info about the first and the last date of every departure
    of every driver and also info about the auto he used
    Please, help me to write the query I need...

  • ant6729

    Valued Member

    Points: 64

    May be 

    But Imnt sure

    strSQL = "SELECT [Drivers$].DriverID, MIN([CarList$].CarListDate), MAX([CarList$].CarListDate), [CarList$].CarId, [CarBrand$].CarBrandName " _& "FROM ((([Drivers$]" _& "inner JOIN [CarList$] ON [Drivers$].DriverID = [CarList$].DriverID)" _& "inner JOIN [Cars$] ON [CarList$].CarId = [Cars$].CarId) left JOIN [CarBrand$] ON [Cars$].CarBrandId = [CarBrand$].CarBrandId) " _& " Group BY [Drivers$].DriverID, [CarList$].CarId, [CarBrand$].CarBrandName "

    Thanks)!

  • HappyGeek

    SSCoach

    Points: 18648

    Just a few observations:
    Your attachment does not contain a query.
    Your attachment contains macros, which may be a virus.
    Your attachment contains links to external objects.
    You need to post DML and DDL if you really want assistance, ignoring the fact this looks a lot like homework or an assignment as it looks awfully like your previous post.

    ...

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply