Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> how to use getdate() in user defined function
Hi,
Im creating a user defined function in sqlserver. The code is down below.
create function ProcessAck()
RETURNS TABLE
AS
BEGIN
DECLARE @Ack VARCHAR(3)
DECLARE @dates DATETIME
SET @Ack='ACK'
END
RETURN ( Select ky_name,dcn,status_dttm from BatchRecon2 where ky_name
not in (Select ky_name from BatchRecon2 where (file_typ='SAK'))AND
(datediff(Hour,status_dttm,dates)>24) AND (file_typ='SIF'))
GO
I am getting the error message" INCORRECT SYSNTAX NEAR BEGIN" PLz help.
Thanks
ashley Received on Wed Feb 08 2006 - 11:02:13 CST