I have 2 tables, the first table is "Sales", in which there are 5 columns, namely: Transaction ID, Transaction Date, Barber ID, Barber Name, Commission.
The second table "Salary List", contains 6 columns, namely: Salary ID, START DATE, END DATE, BARBER ID, BARBER NAME, SALARY.
I have a problem calculating the "SALARY" column based on the "START DATE" and "END DATE" for each BARBER NAME, with the following conditions:
a. If all achievements of the "Commission" column per day are above 50,000 on each specified date (START DATE: END DATE), then SUM all Commissions.
b. If on one of the days from the specified date the "Commission" value is below 50,000, then set the commission to be 50,000 + commission on other dates.
Please help with the above expression.
@babebarbershop wrote:
be 50,000 + commission on other dates
Do not quite understand what this means.
What do you need to do if commissions were 60000, 40000, 40000 during the period?
User | Count |
---|---|
34 | |
8 | |
2 | |
2 | |
2 |