Subject | Re: [firebird-support] MOD without UDF |
---|---|
Author | Arn |
Post date | 2004-12-08T17:00:40Z |
Hi,
Thanks, works perfectly......
Thanks again
Arn
>try this:Hi Markus.
>
>CREATE PROCEDURE PROC_MODULUS( DIVIDEND INTEGER
> , DIVISOR INTEGER )
> RETURNS ( RESULT INTEGER )
>AS
>BEGIN
> /* This procedure calculates the modulus of two numbers */
> IF (Dividend = 0) THEN
> Result = 0;
> ELSE
> Result = Dividend-(CAST((Dividend / Divisor)-0.49 AS INTEGER)*Divisor);
>END
>
>HTH,
>Markus
>
>
>
Thanks, works perfectly......
Thanks again
Arn