Hi All,
How do I add a trigger or any other mechanism to do the following task?
I have a table, say PercentageByCountry.
Sample data in table PercentageByCountry:
ID Country Revenue Percentage(%)
----------------------------------------------
1 United States 30000 30%
2 United States 50000 50%
3 United States 20000 20%
4 Germany 6000 60%
5 Germany 4000 40%
My question is: how can I place a constraint/ trigger, or any other mechanism to ensure that the total percentage for each group (Country) would add up to 100%? Eg: U.S -> 30%+50%+20% = 100%. Germany -> 60%+40% = 100%.
If the user keys in a combination that does not equal to 100%, then I'd like a prompter or warning.
Please help, as I'm not that familiar with MS Access.
Any pointers and sample would be much appreciated.
Thanks in advance.
How do I add a trigger or any other mechanism to do the following task?
I have a table, say PercentageByCountry.
Sample data in table PercentageByCountry:
ID Country Revenue Percentage(%)
----------------------------------------------
1 United States 30000 30%
2 United States 50000 50%
3 United States 20000 20%
4 Germany 6000 60%
5 Germany 4000 40%
My question is: how can I place a constraint/ trigger, or any other mechanism to ensure that the total percentage for each group (Country) would add up to 100%? Eg: U.S -> 30%+50%+20% = 100%. Germany -> 60%+40% = 100%.
If the user keys in a combination that does not equal to 100%, then I'd like a prompter or warning.
Please help, as I'm not that familiar with MS Access.
Any pointers and sample would be much appreciated.
Thanks in advance.