|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 10/8/2009 2:19:21 PM
Posts: 1,
Visits: 0
|
|
Why does this work....
sel YEAR(Date-1) as TEST_YR
But this does not...
replace view dbowner.TEST_V as
( sel YEAR(Date-1) as TEST_YR ) ;
Is there a simple syntax work around I am missing here to use the keyword function YEAR in a view? Thank you!
Kaye
If I can think it, I can code it....on a good day
|
|
|
|
|
Supreme Being
      
Group: Forum Members
Last Login: Yesterday @ 3:55:54 AM
Posts: 111,
Visits: 263
|
|
You are running the query through SQL Assistant and if you look in Tools/ Options/ Query you will see that Allow Use of ODBC Extensions In Queries is allowed.
Microsoft ODBC interface is translating your query to what Bill thinks you want.
Turn this off and run the query again, and you get syntax error.
Microsoft ODBC interface does not attempt to translate DDL statements, so you get an error with or without that option.
Use:
replace view TEST_V as
sel Extract(YEAR from Current_Date - 1) as TEST_YR
That will always work.
|
|
|
|