I exported records and I want to know which record was exported on a particular day. It does not work. Here is the data if I query it.
* comapny Name * * date exported *
ABC Company, Inc 2011-08-01 15:44:52.857
XYZ Company, Inc 2011-08-01 15:44:52.857
I issue this command which does not retrieves the exact matches
select companyname, exporteddate from mytable exporteddate = '2011-08-01' <- does not work
select companyname, exporteddate from mytable exporteddate like '%2011-08-01%' <-- tried this variation too and many other, did not work
The interesting thing is >=, >, <= works. What really is the problem? The exported date is declared as datetime field.
select companyname, exporteddate from mytable exporteddate >= '2011-08-01' <- this works
I am using Windows XP, MS-SQL 2005 SP3 (not exactly but close).