Nested TrueFalse with And

Solved
adamfred Posted messages 12 Status Member -  
adamfred Posted messages 12 Status Member -
Hello,
In a table, I would like to calculate a field named Brut with conditions:
If the value of the Brut field is between 50 and 100, then set Brut = 10;
If the value of the Brut field is between 101 and 200, then set Brut = 25;
If the value of the Brut field is between 201 and 300, then set Brut = 50;
and zero in all other cases.
I have used the following formula with the expression generator:
VraiFaux(ET( [Brut ] >50; [Brut Taxable]<100);10;
VraiFaux(ET( [Brut ] >101;[Brut Taxable]<200);25;
VraiFaux(ET( [Brut ] >201; [Brut Taxable] <=300);50
;0)))
when running the query, an error message occurs.
Could you guide me on the right path
thank you

3 answers

  1. adamfred Posted messages 12 Status Member 2
     
    Hello;
    finally, thanks to your posts, I was able to find the correct syntax which is as follows:
    : VraiFaux([Brut ]>50000 And [Brut ]<100000;750;VraiFaux([Brut]>100000 And [Brut ]<200000;1950;VraiFaux([Brut ]>200000 And [Brut ]<=300000;3250;0)))
    it was necessary to pay attention to the position of the parentheses.
    With the generator, I introduced the IIf, And and Access converted them into "VraiFaux and Et.
    Thank you for everything.
    2