Hi,
I have a log table where a date time is stored in an ntext field.
I need to take this date time and use it to search for other records logged at that date time.
I've tried using a subquery and comparing the datetime to the ntext but this obvioiusly wouldn't work. Converting the ntext to a datetime, nvarchar or varchar isn't working for me either. I get over flow and syntax errors.
example code:
SELECT * FROM tbl_log
WHERE date_time IN
(SELECT data FROM tbl_log)
This is probably a very simple and naive way of attempting it but my SQL knowledge is limited.
date_time (datetime) has the format 2008-04-01 08:13:49.000
and data (ntext) has the format 3/31/2008 2:34:44 PM
if I explicitly use the date as a string e.g. date_time IN ('3/31/2008 2:34:44 PM') the format is still comparable and it works but I need it as a query.
Thanks.