Hello, I am getting a 'Invalid use of 'getdate' within a function.' error when I use this GETDATE() function in my user function. Is there a way to work around this? thanks in advance.
Create Function tb_getCustID ()
Returns @getCustIDTb TABLE
(
[ChangeType] [char] (1) ,
[BeforeID] [char] (16) ,
[AfterID] [char] (16) ,
[BeforeIDType] [char] (2) ,
[AfterIDType] [char] (2)
)
AS
Begin
declare @todayDate Date
set @todayDate = GETDATE() <---------ERROR Raised
.....
Create Function tb_getCustID ()
Returns @getCustIDTb TABLE
(
[ChangeType] [char] (1) ,
[BeforeID] [char] (16) ,
[AfterID] [char] (16) ,
[BeforeIDType] [char] (2) ,
[AfterIDType] [char] (2)
)
AS
Begin
declare @todayDate Date
set @todayDate = GETDATE() <---------ERROR Raised
.....