Link to home
Start Free TrialLog in
Avatar of Sandra Smith
Sandra SmithFlag for United States of America

asked on

Get larger of two values in a query ACCESS 2010

I have a table in an ACCESS 2010 that is only sample data.  However, a user duplicated over 6000 rows but the dollar amounts are different.  So, how do I extract only the larger of say, December amounts for duplicate rows of the same forecast year, account number and type.  That is, for 2010, AcctNo 14587, BUD that has two rows, but December is 100 for one row and 150 for the second row - I need  only get the 150 row.

Sandra
ASKER CERTIFIED SOLUTION
Avatar of Boyd (HiTechCoach) Trimmell, Microsoft Access MVP 2010-2015
Boyd (HiTechCoach) Trimmell, Microsoft Access MVP 2010-2015
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Some pseudocode..

select A.SalesValue, B.RevenueValue,
Case when Sum(A,SalesValue) > Sum(B.RevenueValue) Echo B.SalesValue is bigger than A.RevenueValue End
Case when Sum(B,SalesValue) > Sum(A.RevenueValue) Echo B.SalesValue is bigger than A.RevenueValue End
From SomeTable
Left Outer Join A.Emp_id - B.Emp_id

Open in new window


HTH,

Kent
Avatar of Sandra Smith

ASKER

Sorry it took me so long.  I lost my job and have been in a state of shock.  This did resolve the issue.  Sandra