Hello everyone,
I’ve to set a value on a table using conditions based on a table. I try to better explain, this is the rule-table:
CustomerCode | From | To | Value |
---|---|---|---|
3828 | 08/01/2020 | 15/01/2020 | CA |
905413 | 09/01/2020 | 16/01/2020 | CA |
12751 | 20/02/2020 | 02/03/2020 | CB |
3828 | 20/02/2020 | 02/03/2020 | CB |
In another table I’ve to verify the customer code and if the order date is between From–To, if the record satisfy every condition I’ve to set the field to CA/CB.
usually I’ll go with a function with nested if (if customer=3828 – if orderdate beetween a and b then CA), but I’ve got 50+ rules so I’m asking if is there another way to achieve this.