Posted by manstein on 12/09/05 00:00
Hello TGEAR
Your column is defined as datetime datatype and you have a default
insert of the getdate() function with is also of datatype datetime
there for your value is not stored in the format '10/12/2004 7:28:02
AM' but instead is similar to: '2004-10-12 07:28:02.000'. I say
similar because it depends on the precision of the milliseconds. What
you need to do is format your where clause value to be compatable with
datetime values:
SELECT auditime
FROM testtable
WHERE convert(varchar(50),auditime,120) = '2004-10-12 07:28:02'
your good to go.
best regards
Navigation:
[Reply to this message]
|