Hello,
I think i am missing something. This code give's an error... Can someone
tell me what it is'
IIF(ISNULL(dbo.SalesAnalyse.Verzenddatum), 'unknown',
DATEPART(yyyy.SalesAnalyse.Verzenddatum))
tnx in advance..
eric1) IIF is not a function is T-SQL.
2) ISNULL accepts 2 arguments, not 1.
3) DATEPART accepts 2 arguments; separate the datepart (yyyy) from the date
with a comma, not a period.
I assume you want this?
ISNULL(CAST(DATEPART(yyyy, SalesAnalyse.Verzenddatum) AS VARCHAR(8)),
'unknown')
Jacco Schalkwijk
SQL Server MVP
"Judith van der Niet" <jniet@.mit.com> wrote in message
news:e5QpjKfDFHA.4072@.TK2MSFTNGP10.phx.gbl...
> Hello,
> I think i am missing something. This code give's an error... Can someone
> tell me what it is'
> IIF(ISNULL(dbo.SalesAnalyse.Verzenddatum), 'unknown',
> DATEPART(yyyy.SalesAnalyse.Verzenddatum))
> tnx in advance..
> eric
>
Friday, February 24, 2012
IIF(ISNULL(dbo.SalesAnalyse.Verzenddatum), 'unknown', DATEPART(yyyy.SalesAnalyse.Verz
Labels:
code,
database,
datepart,
dbo,
dbosalesanalyseverzenddatum,
error,
iif,
isnull,
microsoft,
missing,
mysql,
oracle,
salesanalyse,
server,
someonetell,
sql,
unknown,
verzenddatum,
yyyysalesanalyseverz
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment