+ Reply to Thread
Results 1 to 3 of 3

many rows w/two columns i need max value return for row

  1. #1
    Registered User
    Join Date
    10-16-2008
    Location
    Modesto
    Posts
    10

    Question many rows w/two columns i need max value return for row

    Good afternoon! I think this is a relatively simple thing to do, but I do now know how! I am using MS Access 2007

    Here is a sample of my data table. Top row is column headings. This is a multi-row table. Columns seperated by -

    Product - Week - column 1 value - column 2 value
    LEGS - WK1 - 20 - 40
    DRUMS - WK4 - 60 - 0

    I need to have the query return the following:
    LEGS - WK1 - 40
    DRUMS - WK4 - 60

    I need SQL code or another way of bringing back the max value of column 1 value and column 2 value in my query results.
    Last edited by jonbdraco; 10-26-2011 at 03:42 PM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: many rows w/two columns i need max value return for row

    In a new column in a query type
    Max Value: IIF([Column 1 Value] > [Column 2 Value], [Column 1 Value], [Column 2 Value])

    Make sure that the check box to display Columns 1 and Columns 2 are unchecked in your query.

    Your SQL Statement would look something like this:

    Please Login or Register  to view this content.
    Alan
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    10-16-2008
    Location
    Modesto
    Posts
    10

    Re: many rows w/two columns i need max value return for row

    awesome!!! That worked! Thank you sooo much. This is a pretty dang easy solution

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1