I'm not a rules guy, so I would rather validate the entry when leaving the
field or row using an eep. i.e.,

SEL SUM weight_percentage INTO vttlpct FROM components WHERE receipt = "CAKE"
IF vttlpct > 100 THEN
  ... error here
ENDIF

(I guess you could also do it forms expressions.)

Regards,

Dennis
*****



At 07:00 PM 2/23/02 -0500, you wrote:
>
>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/
>
>
Dennis Fleming
IISCO
http://www.TheBestCMMS.com
Phone: 570 775-7593
Fax:   570 775-9797
================================================
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