ISOWeek error in SQL Server 2008 -
my problem sql server 2008. if execute:
select dbo.isoweek(getdate())
i error
msg 4121, level 16, state 1, line 1
cannot find either column "dbo" or user-defined function or aggregate "dbo.isoweek", or name ambiguous.
running same command on database gives me expected response: "30"
is there cause this?
there no built in sql server function called isoweek
, database you're running query in (where works) have user defined function called isoweek
present?
a syntax work built-in, using datepart
function is:
select datepart(iso_week, getdate())
which return 30
@ time of writing, i.e. if call with:
select datepart(iso_week, '2017-07-28 00:00:00.000')
Comments
Post a Comment