Hello guys,
My problem is next. When Im doing calculations for workers there will be a case when Im doing calculation at the same year/month and same type of calculation but for different company.
Example1:
YearMonth- 201901 TypeOfCalculation- PAYM
YearMonth- 201901 TypeOfCalculation- LOAN
And this works just fine as will the relationships as you can see on pictures number 4 and 5.
Example2:
YearMonth- 201901 TypeOfCalculation- PAYM
YearMonth- 201901 TypeOfCalculation- PAYM
And there I get the error that duplicates cant happen, thats good coz we dont want them.
In the exactly same example/table (Calculations) I want to add a CompanyCode field so I can do calculations based on all 3 fields.
It works like this:
Example3:
YearMonth- 201901 TypeOfCalculation- PAYM CompanyCode- CMP1
YearMonth- 201901 TypeOfCalculation- PAYM CompanyCode- CMP2
This is how it works after adding the CompanyCode, just like in the first example, just with CompanyCode in it, whats grate.
Example4:
YearMonth- 201901 TypeOfCalculation- PAYM CompanyCode- CMP1
YearMonth- 201901 TypeOfCalculation- PAYM CompanyCode- CMP1
And this is where I get the error for no duplicates again and thats what I want, cool.
Now to the problem. After making the fields YearMonth/TypeOfCalculation/CompanyCode, primary keys or so called composite keys that works fine, I dont get any errors but when I want to create a relationship between the table Calculation and PersonalIncomeOfWorker I get the error just like in the title and as you can see in pictures number 1,2 and 3, but I dont get the error when making the relationship with only 2 composite keys in the Calculation field which are YearMonth/TypeOfCalculation.
Edit: I assume I need the CompanyCode added in the PersonalIncomeOfWorker table too, because doing so I can make the relationship. So my relationship design is probably wrong or?
Thanks
My problem is next. When Im doing calculations for workers there will be a case when Im doing calculation at the same year/month and same type of calculation but for different company.
Example1:
YearMonth- 201901 TypeOfCalculation- PAYM
YearMonth- 201901 TypeOfCalculation- LOAN
And this works just fine as will the relationships as you can see on pictures number 4 and 5.
Example2:
YearMonth- 201901 TypeOfCalculation- PAYM
YearMonth- 201901 TypeOfCalculation- PAYM
And there I get the error that duplicates cant happen, thats good coz we dont want them.
In the exactly same example/table (Calculations) I want to add a CompanyCode field so I can do calculations based on all 3 fields.
It works like this:
Example3:
YearMonth- 201901 TypeOfCalculation- PAYM CompanyCode- CMP1
YearMonth- 201901 TypeOfCalculation- PAYM CompanyCode- CMP2
This is how it works after adding the CompanyCode, just like in the first example, just with CompanyCode in it, whats grate.
Example4:
YearMonth- 201901 TypeOfCalculation- PAYM CompanyCode- CMP1
YearMonth- 201901 TypeOfCalculation- PAYM CompanyCode- CMP1
And this is where I get the error for no duplicates again and thats what I want, cool.
Now to the problem. After making the fields YearMonth/TypeOfCalculation/CompanyCode, primary keys or so called composite keys that works fine, I dont get any errors but when I want to create a relationship between the table Calculation and PersonalIncomeOfWorker I get the error just like in the title and as you can see in pictures number 1,2 and 3, but I dont get the error when making the relationship with only 2 composite keys in the Calculation field which are YearMonth/TypeOfCalculation.
Edit: I assume I need the CompanyCode added in the PersonalIncomeOfWorker table too, because doing so I can make the relationship. So my relationship design is probably wrong or?
Thanks
Attachments
Last edited: