newbie_sql
SSC Eights!
Points: 954
More actions
February 12, 2010 at 8:36 am
#145135
I have a user defined function which has 2 parameters func_x (@A datetime, @b-2 int)
When i give a call as select func_x(Getdate(), 1)- it gives me an error 'Incorrect syntax near Getdate'
I am running in query analyzer-any ideas?
irobertson
Hall of Fame
Points: 3695
February 12, 2010 at 9:28 am
#1118110
Pass your date in as a variable:
declare @mydate datetime
set @mydate = getdate()
select func_x(@mydate ,1)
Iain
Steve Jones - SSC Editor
SSC Guru
Points: 736270
February 12, 2010 at 10:59 am
#1118163
Iain has the idea. The call doesn't want a function as a parameter. You need to assign it first.
Seems silly to me, but probably some technical reason that doesn't seem worth fixing.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply