Below is a SQL statement I am running. The query returns 0 records, but it should return 1 record. The problem is with the end_time portion of the where clause, though I don't know how to fix it.
Please help
SELECT dc_id, taskdtl_id, userid, start_time, end_time, total_time, billable, opcode_id FROM data_collection WHERE taskdtl_id = 240 and userid = 1 and end_time = 01/05/04
In SQL Server there is no such thing as a "Date" Type Field - only "DateTime" so what's happening here is that 01/05/04 is being transalated 01/05/04 12:00:00 AM
If you're looking for a record for a particular date you may want to use ...end_time > '01/05/04' or ...end_time between '01/05/04' and '01/06/04'