SQL Server Cannot Call Methods on Date

You are correct, it is a bug in SSMS. I’m using SQL Server Management Studio 2008 R2 and when I try to create a View using the built-in designer, I get the same error message as you:

SQL Execution Error
Error Source: .Net SqlClient Data Provider
Error Message: Cannot call methods on date.

As @Aaron Bertrand mentioned, to solve the issue, select ‘New Query’ and create the View in the Query window. For your code, it would be:

CREATE VIEW myView AS
SELECT     ID, ScheduleID, ShiftDate, CAST(ShiftDate AS DATE) AS ProductionDate
FROM       dbo.ScheduleResults

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)