SQL SERVER 2008 r2
I'm trying to Create an Indexed view however I'm getting the following error
Cannot create index on view '' because the view uses an implicit conversion from string to datetime or smalldatetime. Use an explicit CONVERT with a deterministic style value.
The issue is with an INT column [GPSTime] that records the number of seconds from '1970-01-01 00:00:00' and I'm trying to CONVERT/CAST this is to a DATETIME, eg
CAST(DATEADD(SS,[GPSTime],'1970-01-01' ) AS DATETIME)
or
CONVERT(VARCHAR,DATEADD(SS,[GPSTime],'1970-01-01' ),113)
or
CONVERT(DATETIME,DATEADD(SS,[GPSTime],'1970-01-01' ),113)
Each of the three options above gives me the error I mentioned earlier.
Is the way around this?