google-code-export / dataobjectsdotnet

Automatically exported from code.google.com/p/dataobjectsdotnet
0 stars 0 forks source link

Translation of DateTime.Date for SqlServer 2008 #860

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
похоже Date неправильно работает
[18:45:23] Филатов Алексей: он транслируется в 
DATEADD(MS, (- DATEPART(MILLISECOND , [b].[CreationTime])), DATEADD(SECOND, (- 
DATEPART(SECOND , [b].[CreationTime])), DATEADD(MINUTE, (- DATEPART(MINUTE , 
[b].[CreationTime])), DATEADD(HOUR, (- DATEPART(HOUR , [b].[CreationTime])), 
[b].[CreationTime]))))
[18:45:57] Филатов Алексей: в итоге получаются 
значения типа 2010-11-25 00:00:00.0008419

there is more optimal way to trancate time from datetime:
cast([OrderDate] as date)

Original issue reported on code.google.com by Dmitri.Maximov on 30 Nov 2010 at 4:32

GoogleCodeExporter commented 9 years ago

Original comment by alexey.g...@gtempaccount.com on 1 Dec 2010 at 10:08

GoogleCodeExporter commented 9 years ago

Original comment by alexey.g...@gtempaccount.com on 1 Dec 2010 at 12:15