HI
I have a query that runs ok when I run it in query window and gives the results required. If I add the query into a view I am getting the attached error message when I run it. I believe it is because when pasting it into the view it is changing this row from
DATEADD(year, 0, CAST(CONCAT(CalendarMonth, '/1/', CalendarYear) as date))as Date1 TO DATEADD(year, 0, CAST({ fn CONCAT(dbo.ProductAnalysis.CalendarMonth, '/1/', dbo.ProductAnalysis.CalendarYear) } AS date)) AS Date1
And
CONCAT(CHOOSE(CalendarMonth,'Jan', 'Feb', 'Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'), ' ', CalendarYear) As FullDate TO { fn CONCAT(CHOOSE(dbo.ProductAnalysis.CalendarMonth, 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'), ' ', dbo.ProductAnalysis.CalendarYear) } AS FullDate
It is putting in {fn at the beginning with } at the end which is a function, I don't want the function there just the normal code, any ideas please how to get round this
I have a query that runs ok when I run it in query window and gives the results required. If I add the query into a view I am getting the attached error message when I run it. I believe it is because when pasting it into the view it is changing this row from
DATEADD(year, 0, CAST(CONCAT(CalendarMonth, '/1/', CalendarYear) as date))as Date1 TO DATEADD(year, 0, CAST({ fn CONCAT(dbo.ProductAnalysis.CalendarMonth, '/1/', dbo.ProductAnalysis.CalendarYear) } AS date)) AS Date1
And
CONCAT(CHOOSE(CalendarMonth,'Jan', 'Feb', 'Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'), ' ', CalendarYear) As FullDate TO { fn CONCAT(CHOOSE(dbo.ProductAnalysis.CalendarMonth, 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'), ' ', dbo.ProductAnalysis.CalendarYear) } AS FullDate
It is putting in {fn at the beginning with } at the end which is a function, I don't want the function there just the normal code, any ideas please how to get round this