Subject Re: [firebird-support] MOD without UDF
Author Arn
Hi,

>try this:
>
>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
>
>
>

Hi Markus.

Thanks, works perfectly......

Thanks again

Arn