title: SQL Server Cannot Call Methods on Date
body: <p>I've got a DATETIME column in a SQL Server 2008 table called ShiftDate. I want to convert this to a DATE column in a query:</p>
  
  <pre><code>SELECT     ID, ScheduleID, ShiftDate, CONVERT(DATE, ShiftDate) AS ProductionDate
  FROM       dbo.ScheduleResults
  </code></pre>
  
  <p>I am editing this query in SSMS. If I run the query in a standard query window, I don't get any errors. If I run this in the View editor window, I get the error "Cannot Call Methods on Date".</p>
  
  <p>I've tried the CAST method but it gets the same error.</p>
  
  <pre><code>SELECT     ID, ScheduleID, ShiftDate, CAST(ShiftDate AS DATE) AS ProductionDate
  FROM       dbo.ScheduleResults
  </code></pre>
  
  <p>The full error message is: </p>
  
  <pre><code>Executed SQL statement: SELECT ID, ScheduleID, ShiftDate, CAST(ShiftDate as DATE).ToString() AS ProductionDate FROM dbo.ScheduleResults
  Error Source: .Net SqlClient Data Provider
  Error Message: Cannot call methods on date.
  </code></pre>
  
  <p>I am inclined to think this is a bug in SSMS, but I would like to get some feedback from StackOverflow folks as to how to convert a datetime column to a date. I can easily convert it to a string column, but it is not ideal as Excel will not see it as a date. </p>