Microsoft Access に関数があり、このエラーが発生しています。ADO エラー: 関数内での 'getdate' の使用が無効です。このエラーの回避策はありますか?
これが私のMicrosoft Access関数です:
ALTER function dbo.WaitListFTN ()
Returns @temp
TABLE (
[Last Name] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[First Name] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[MName] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Location] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[waitlist date] [datetime] NULL ,
[gender] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[county] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[closedate] [datetime] NULL ,
[admitdate] [datetime] NULL
)
as
Begin
Insert @temp
SELECT [Last Name],
[First Name],
[MName],
[Location],
[waitlist date],
[gender],
[county],
[closedate],
[admitdate]
FROM dbo.TableTest
WHERE (([close] =0 or [close] is null))
AND (Date > '12/1/2007')
AND (DATEDIFF(d, Date, GETDATE()) > 30) ***This is where I'm getting the error.***
ORDER BY [waitlist date] asc
Return
end