Another possibility would be to use the CONVERT function to remove the time portion of the datetime as in:
and convert(char(10),end_time,101) = '01/05/2004'
The third parameter defines the formatting of the date. In Books on-line you can find the other possible formatting values.
Mike A.
>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
>
Michael P. Antonovich, MCSD
Email: mike@micmin.com
MicMin Associates - Orlando, FL