I stored datetimes in a large table with odbc canonical format.
So I want to extract fields that match only a part of a date, in italian format.
Date in rows: 2012-07-13 14:58:00.000, 2012-07-13 14:03:00.000, 2012-07-11 08:54:00.000 and so on...
Date to find: 13-07-2012 (gg-mm-yyyy)
I can do the search by doing, for example:
SELECT * FROM DATABASE.dbo.MyTable
WHERE CONVERT(datetime,CAST(myDateTimeField AS date),105) = CONVERT(datetime,CAST('13-07-2012' AS date),105)
It's simple, ok, but c
↧