Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8751233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:00:31+00:00 2026-06-13T13:00:31+00:00

I am trying to query data for transactions. I want to get multiple columns

  • 0

I am trying to query data for transactions. I want to get multiple columns for the latest dated transaction. PONumber, Vendor, Price for each item, last time purchased. For example:

Data:

PONumber    Item    Vendor    Price    DateOrdered
1           ABC     Wal-Mart  1.00     10/29/12
2           ABC     BestBuy   1.25     10/20/12
3           XYZ     Wal-Mart  2.00     10/30/12
4           XYZ     HomeDepot 2.50     9/14/12

Desired Result Set:

PONumber    Item    Vendor    Price    DateOrdered
1           ABC     Wal-Mart  1.00     10/29/12
3           XYZ     Wal-Mart  2.00     10/30/12

Trying to use max function on DateOrdered, but when I include the vendor I get the last purchase for each vendor and item (too many rows). I need one record for each item. Any ideas on how to accomplish? Using MS Access 2007 with ODBC to oracle tables. Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T13:00:32+00:00Added an answer on June 13, 2026 at 1:00 pm

    How about:

    SELECT 
       tran.PONumber, 
       tran.Item, 
       tran.Vendor, 
       tran.Price, 
       tran.DateOrdered
    FROM tran
    WHERE tran.DateOrdered = (
       SELECT Max(DateOrdered) 
       FROM tran t 
       WHERE t.item=tran.item)
    

    Where tran is your table.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to get my data from a query string, but use it
i am trying to send multiple data using j query $.ajax method to my
I am trying to query and parse Yahoo fantasy sports data and show results
I'm trying to query a table with a column which is xml data with
I am currently trying to learn how to query RDF data with SPARQL using
I am trying to connect to my db with C# and query some data.
I'm getting a timeout error when trying to execute a LINQ (-to-SQL) query System.Data.SqlClient.SqlException:
I am trying to do a simple AJAX function to send data from query
I am trying to graph data that I am pulling from an ActiveRecord query
I am trying to write the query for existing table data. TABLE_A and TABLE_B

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.