Problem with UDF & decimal

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Losing what's left of my hair over this one, cannot get this to work. Access
2003
-----------------------------------------------------------------------------
FUNCTION dbo.mbtest
(@parameter decimal(3,2) )
RETURNS decimal(3,2)
AS
BEGIN
select @parameter = @parameter
RETURN @parameter
END

----------------------------------------------------------------

If I run this from an ADP and input 5.5 it returns 5, if I input .5 it
returns 0

Actually I have a much more complex function that does not work, but this is
the essence of my problem. Does not see the value to the right of the decimal
poiint.

What am I missing?
 
Don't know how you try to call your stuff but if you are using a string, did
you try enclosing the decimal value between single quotes?
 
Just for testing I simply click on it in the ADP, the input box pops up
"enter parameter value"

OK - I just tried it.
Won't accept quotes, "you may have entered text in a numeric field" which is
what I would expect as the parameter is delred as a numeric.
--
Thanks!
MB


Sylvain Lafontaine said:
Don't know how you try to call your stuff but if you are using a string, did
you try enclosing the decimal value between single quotes?
 
Oh, I'm sorry but I never used the input pop up box for parameters of ADP;
so I cannot tell you more on this.

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: http://cerbermail.com/?QugbLEWINF


Mbam said:
Just for testing I simply click on it in the ADP, the input box pops up
"enter parameter value"

OK - I just tried it.
Won't accept quotes, "you may have entered text in a numeric field" which
is
what I would expect as the parameter is delred as a numeric.
 
What if you make the function's input parameter varchar and convert it to
decimal in the function?

The input box may be receiving it as a string.

Alan
 
Back
Top