Results 1 to 8 of 8
  1. #1
    ruthndul is offline Novice
    Windows 10 Office 365
    Join Date
    May 2022
    Posts
    4

    Newbie to query

    Hi, I'm new to MS Access,

    Having difficulties with queries, to show the most recent price from a table like below:





    Query design view:


    Query result:



    Which is not correct.
    It is supposed to be

    Orange $6 as of 5/5/22
    Apple $0.5 as of 5/6/22

    Can someone help please?

    Thank you in advance.

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Welcome to the site. Your images didn't come through, so maybe try again? Or post the SQL, somebody may get it from that.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    ruthndul is offline Novice
    Windows 10 Office 365
    Join Date
    May 2022
    Posts
    4
    Here is the screenshot.
    Click image for larger version. 

Name:	price.jpg 
Views:	14 
Size:	41.8 KB 
ID:	47761

    Click image for larger version. 

Name:	query.jpg 
Views:	14 
Size:	16.4 KB 
ID:	47762

    Click image for larger version. 

Name:	recent.jpg 
Views:	14 
Size:	16.2 KB 
ID:	47763

  4. #4
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I think you need something like this:

    http://www.baldyweb.com/LastValue.htm

    It can be done as subquery, but in my view easier to view as 2 queries.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    ruthndul is offline Novice
    Windows 10 Office 365
    Join Date
    May 2022
    Posts
    4
    Thanks pbaldy,
    Can you elaborate more how does 2 queries work to solve this issue?

  6. #6
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I thought I did, but the first query finds the latest date per item, the second uses that to find the other information from that record.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    ruthndul is offline Novice
    Windows 10 Office 365
    Join Date
    May 2022
    Posts
    4
    I figured out...
    I did the 2 queries.
    thanks for the clue pbaldy

  8. #8
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Query Newbie
    By Treecat in forum Queries
    Replies: 7
    Last Post: 09-16-2019, 06:40 AM
  2. Query Newbie
    By Treecat in forum Queries
    Replies: 1
    Last Post: 09-13-2019, 01:19 PM
  3. Replies: 11
    Last Post: 04-08-2015, 02:55 PM
  4. Newbie Query
    By sordfish555 in forum Access
    Replies: 1
    Last Post: 11-17-2013, 03:49 AM
  5. Newbie Help with Access Query
    By MartyMojito in forum Access
    Replies: 1
    Last Post: 03-17-2011, 02:50 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums