Link to home
Start Free TrialLog in
Avatar of schmir1
schmir1Flag for United States of America

asked on

Access 2000 Query to use the larger of two numbers

I need to use the larger of two numbers in a calculation in my query.

Pseudo code would be like:

If Inventory_Qty > Order_Qty then
  ' Inventory_Qty - Components_needed = Surplus (below is the SQL)
  ([Inventory].[Quantity]-([Forms]![BOM_Queries]![txtBuilds]*[Qty per Asm])) AS Surplus)  
else
  'Order_Qty - Components_needed = Surplus
  ([Orders Subtable].[Quantity]-([Forms]![BOM_Queries]![txtBuilds]*[Qty per Asm])) AS Surplus)
end if

It has to be SQL as it is part of a Access 2000 Query.
ASKER CERTIFIED SOLUTION
Avatar of Raynard7
Raynard7

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
Avatar of schmir1

ASKER

Thanks works great.