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 9022655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:34:03+00:00 2026-06-16T05:34:03+00:00

I have an Access database that is used by 3 separate people offsite; this

  • 0

I have an Access database that is used by 3 separate people offsite; this offsite location does not have a network link (nor can it).

I have three identical databases and thus three identical tables. Each user fills in information using the same Primary keys. For this ‘food evaluation’ example:

Item       |      Color       | Timestamp

PERSON 1 (first database)
Carrot     |     Orange       | 2012-12-21 13:00:00
Watermelon |     Red          | 2012-12-21 19:00:00 <--
Blueberry  |     Blue         | 2012-12-21 17:00:00 <--

PERSON 2 (second database)
Carrot     |     Yellow       | 2012-12-21 15:00:00 <--
Apple      |     Green        | 2012-12-21 15:00:00 <--

PERSON 3 (third database)
Watermelon |     Green        | 2012-12-21 11:00:00 
Apple      |     Red          | 2012-12-21 14:00:00
Orange     |     Orange       | 2012-12-21 15:00:00 <--

I need to output a table:

Blueberry  |     Blue         | 2012-12-21 17:00:00
Watermelon |     Red          | 2012-12-21 19:00:00
Carrot     |     Yellow       | 2012-12-21 15:00:00
Apple      |     Green        | 2012-12-21 15:00:00
Orange     |     Orange       | 2012-12-21 15:00:00

So, based on timestamp, I need to choose only ONE of the duplicates but also have all of the non-duplicates (Item is a Primary, Unique Key). I just can’t for the life of me get the SQL for this..
Using

SELECT Item, Color, MAX(timestamp) 
FROM (SELECT ... FROM first 
UNION SELECT ... FROM second
UNION SELECT ... FROM third)
GROUP BY Item, Color

But since it MUST group on Color to get a MAX function, it still creates index violations.

So.. how do I get this output?

  • 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-16T05:34:05+00:00Added an answer on June 16, 2026 at 5:34 am

    You’re ignoring Color initially, just trying to find the latest Timestamp for each Item. So you must write a query that does only that, then you can JOIN it with the full table.

    select a.Item, a.Color, a.Timestamp
    
    from
    (SELECT ... FROM first 
    UNION SELECT ... FROM second
    UNION SELECT ... FROM third) a
    
    inner join
    
    (SELECT Item, MAX(timestamp) as MaxTime
    FROM (SELECT ... FROM first 
    UNION SELECT ... FROM second
    UNION SELECT ... FROM third) z
    GROUP BY Item) b
    
    on a.Item = b.Item and a.Timestamp = b.MaxTime
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an C# form application that use an access database. This application works
I have an Microsoft Access database that is used internally by my company. Our
I have an Access 2007 database that works asynchronously with a MAS200 database. Due
I have a ms access database that has one table for each photo album
Just need some quick clarification I have 2 Queries in my Access Database that
I have a MS access database. In that, one table consists of questions and
In an access database I have a small function that is called on startup
I have a client that uses a point-of-sale solution involving an Access database for
I'm writing an Access database. I have a number of forms that are identical.
I have a user Sql Authentication account that has remote access to my database

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.