Announcements
This site is in read only until July 22 as we migrate to a new platform; refer to this community post for more details.

Count and sum

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.

0 1 65
1 REPLY 1


@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?

Top Labels in this Space