Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help with UDF
Message
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
Other
Title:
Help with UDF
Miscellaneous
Thread ID:
00900778
Message ID:
00900778
Views:
46
Hi all, I've created an UDF but when trying to access it I'm getting the error message
Server: Msg 208, Level 16, State 1, Line 1
object name 'dbo.fn_dias' is invalid.
to call the udf I'm using:
select dbo.fn_dias('2','210001')
and here's the code:
CREATE FUNCTION dbo.Fn_Dias (@pCuenta varchar(5),@pTipoMovi varchar(6))  
RETURNS table 
 AS  
return SELECT DATEDIFF(Day, (SELECT Fecha
                          FROM   Transac01
                          WHERE  Documento = Transac02.documento1 AND 
				             Tipomovi = Transac02.Tipomovi1), fecha)  as dias
FROM      TRANSAC02
WHERE     (cuenta = @pCuenta) AND (tipomovi = @pTipoMovi) 
At this time I just don't know what I'm doing wrong, so I'd appreciate any help!

Enmanuel
I'm a mixture of Albert Einstein and Arnold Schwarzenegger. The only trouble is that I got Einstein's body and Schwarzenegger's brain
Next
Reply
Map
View

Click here to load this message in the networking platform