Hi all,


I have a table that contains the components for a receipt.
Each row contains 3 columns :

Receipt TEXT (8)
Component TEXT (8)
Weight_Percentage DOU

Example :
'Cake','Egg',10.
'Cake','Butter',25.
'Cake','Flour',50.
... and so on.

I am looking for a rule able to prevent user to enter new rows or change
existing rows such as the sum of Weight-Percentage stay less or equal to
100 %

I tryed :
RULES 'Receipt incorrect' FOR composition SUCCEEDS +
      WHERE (100 -Weight_Percentage) >= (SELECT SUM(Weight_Percentage) FROM
composition T1 +
      WHERE T1.Receipt = composition.Receipt)
and
RULES 'Composition incorrecte' FOR composition SUCCEEDS +
      WHERE Receipt NOT IN +
      (SELECT Receipt FROM composition GROUPED BY Receipt +
      HAVING (SUM(Weight_Percentage) > 100))
without any success ....

Suggestions are welcomes ....
TIA

J.M. GRATIAS, Logimatique, France
================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: INTRO rbase-l
================================================
TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: UNSUBSCRIBE rbase-l
================================================
TO SEARCH ARCHIVES:
http://www.mail-archive.com/rbase-l%40sonetmail.com/

Reply via email to