1

I am trying to get the date component in this query. How can I create a query that is the most efficient?

UPDATE  myTable

WHERE
    [DateTime] = @DateTime
AND
Pindakaas
  • 4,389
  • 16
  • 48
  • 83
  • possible duplicate of [Best approach to remove time part of datetime in SQL Server](http://stackoverflow.com/questions/1177449/best-approach-to-remove-time-part-of-datetime-in-sql-server) – Mikael Eriksson Nov 14 '11 at 06:28

1 Answers1

4

SQL 2008 has a DATE datatype:

CAST(@DateTime AS DATE)

I cannot put it in better context without more of your UPDATE statement

Adam Wenger
  • 17,100
  • 6
  • 52
  • 63