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.
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:
AlanSelect Product, Week, IIF([Column 1 Value] > [Column 2 Value], [Column 1 Value], [Column 2 Value]) As Max Value FROM YourTableName;
Alan
Click the * below to say thanks.
Database Principles
Pivot Table Tips
Good Excel Video Tutorials
Sumifs or SumProduct
DataPig Access Tutorials
MS Query Tutorial
Worst Pie Chart Ever?
awesome!!! That worked! Thank you sooo much. This is a pretty dang easy solution
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks