Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2005
    Posts
    4

    Unanswered: Advanced to value Query

    Have a DB keepingtrack of production Lines and the time the line ends. Need a top value query to show only the last run of each line.

    The way I rigged it is by sorting by end time desending, filter by the line (IE Line 1) and then showing the otp value of 1.

    I then re-write the query for all 30 lines and use a union query to combine them all.

    It is frustrating and there has to be a better way

  2. #2
    Join Date
    Oct 2005
    Posts
    6
    can you supply some xample data?

  3. #3
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    Have you used a "Totals Query" - if not, check it out because I think it will accomplish exactly what you want.

    Assuming each production run has an index (if not, add one), then you set your query up to "Group By Production Line", "Order By Run Date/Time" and to "Show Last Index"

    The result is a list of the index value for the most recent run of each production line. You add that to a Select Query to add all the human readable stuff like the name of the production line, etc. and you're in business.

    Good luck
    have fun!

    Todd S.
    click to email


    Independent Development Consultant
    Biz db & reports - SQL, Access, Crystal, Seradex and more
    Small, custom, unique programs - Office, VBA, .NET


    _________________________________________________
    Favorite message from Windows:
    There was an error displaying the previous error message

    Sadly, there was no error number to look up ...

  4. #4
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6

Posting Permissions

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