Search code examples
ms-accessroundinglookupms-access-2016lookup-tables

Rounding Up Number to the Nearest Value on Another Table


is this something that's possible to achieve in Ms. Access?

I have two table, first table is a calculated product requirement:

enter image description here

Second Table is the fixed adjusted rate specific to each product (since there's a fix output rate from the equipment we used to apply the product and have to split them in a very specific rate)

enter image description here

The goal would be to generate this table (so I can link it to the table 2 and get a specific split rate required by the equipment)

enter image description here

I have been cranking my head for hours but couldn't find a solution yet. Any help would be appreciated :)


Solution

  • You can also try below query-

    Select t.product, MIN(t.adjusted) as Adjusted from 
        (SELECT t1.Product, t2.Adjusted
        FROM Table1 as t1 INNER JOIN Table2 as t2 ON t1.Product = t2.Product
        WHERE (t2.Adjusted>t1.calculated)) as t Group by t.Product;
    

    enter image description here