[dba-SQLServer] DateTime Hell!

Selina Iddon selina at easydatabases.com.au
Thu Oct 2 07:14:00 CDT 2003


Hi Everyone
I haven't participated in this list too much because I'm relatively new to
SQL and with the help of Susan's book and reading this list have been
struggling through, but this one has me at my wits end.

I am passing a parameter to a stored procedure and using this ID it
retrievies the datetime from a view and is assigned to a variable.  I then
want to assess whether the times overlaps with other datetimes in the same
view.  The stored procedure is converting the date format to 2003-10-03
14:00:00.000 when putting it in the variable and my view has the date time
formatted as 3 Oct 2003 2:00:00 PM and they won't compare to each other,
even though they are both happily inside convert(datetime,XXX) functions and
have come from the same field in the same view.  I've tried using
convert(datetime,XXX,13) replacing the 13 with 6, 9 and multiple other
combinations as described on a web site I found, but nothing works.

Please Please help if you can.  I've lost days on this project which is due
Monday (in my dreams!)

TIA
Selina




More information about the dba-SQLServer mailing list