Problem with UDF & decimal

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?
 
S

Sylvain Lafontaine

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?
 
G

Guest

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?
 
S

Sylvain Lafontaine

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.
 
A

Alan Z. Scharf

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top