0

I have a function in Microsoft Access and I'm getting this error; ADO error: Invalid use of 'getdate' within a function. Is there a work around for this error?

Here is my Microsoft Access function:

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
4

1 回答 1

0

GETDATE() 仅适用于 T-SQL,无法在 Access 中翻译,请尝试使用 NOW()

于 2013-07-03T19:26:58.400 回答