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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:03:41+00:00 2026-06-07T00:03:41+00:00

I a MSAccess database which contains the following table Table A # Column1    Column2    Amount =======    =======    ======

  • 0

I a MSAccess database which contains the following table

Table A

#

Column1    Column2    Amount
=======    =======    ======
Value1        Total+        100
Value1        Total-        -50
Value2        Total-        -233
Value2        Total+        +5

I want to be write a query that will give me distinct rows for the highest absolute amounts

Expected Results
Column1    Column2    Amount
=======    =======    ======
Value1         Total+     100
Value2         Total-     -233

  • 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-07T00:03:43+00:00Added an answer on June 7, 2026 at 12:03 am

    This result set can be retrieved with the following query.

    Column1 max_abs_value
    Value1            100
    Value2            233
    
    SELECT
        Column1,
        Max(Abs(Amount)) AS max_abs_value
    FROM Table_A
    GROUP BY Column1;
    

    Then, if you want to see the values of Column2 and Amount for those same rows, you can create a query which uses the first one as a subquery and which you join to Table_A.

    SELECT
        a.Column1,
        a.Column2,
        a.Amount
    FROM
        Table_A AS a
        INNER JOIN (
            SELECT
                Column1,
                Max(Abs(Amount)) AS max_abs_value
            FROM Table_A
            GROUP BY Column1
        ) AS sub
        ON a.Column1 = sub.Column1
    WHERE
        Abs(Amount)=sub.max_abs_value;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

when i give this sql query in my msaccess database table called warehouse1 it
I have an ms-access database called db.mdb and it contains various table. I;m creating
I have an MS Access database that contains a table of dates, scores and
I have a vbscript which does the following: Open an access 2003 database Run
I have a ms access database that has one table for each photo album
I have an ASP Access database that contains strings in various European languages. The
In a database I'm having to design for MS Access, I have a table
Ok, so I need to populate a MS Access database table with results from
I have the following code: CurrentDb.Execute DROP TABLE [ & DatabaseName & ].[ &
I'm using an MS Access .mdb database in my C# application. The database contains

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.