Dear Group
Some but not all of the dates are incorrect converted (incremented by 1
day) with the following SQL statement.
SELECT DISTINCT CONVERT(datetim e,cast(Returned ByDate AS int)) AS
ReturnedByDate, CONVERT(varchar (10),ReturnedBy Date,104) AS
LabelReturnedBy Date, ReturnedByDate FROM i2b_keytransact ionhistory
ORDER BY ReturnedByDate ASC
'ReturnedByDate ' is of type smalldatetime in the table. I need the
result set to return me the ReturnByDate once as actual date values
(for the value of a dropdown) and once as text values (for the text of
the same dropdown). It all works fine, it's just that some actual date
values are incremented by one day. The third column in the result set
sample represents the actual database value as a reference to give you
an idea of the original value.
ReturnedByDate LabelReturnedBy Date ReturnedByDate
------------------------- ------------------- -------------------
2004-11-05 00:00:00.000 04.11.2004 2004-11-04 15:22:00
2004-11-11 00:00:00.000 11.11.2004 2004-11-11 00:00:00
2004-11-12 00:00:00.000 12.11.2004 2004-11-12 00:29:00
2004-11-22 00:00:00.000 21.11.2004 2004-11-21 20:23:00
2004-11-22 00:00:00.000 21.11.2004 2004-11-21 20:24:00
2004-11-22 00:00:00.000 21.11.2004 2004-11-21 21:10:00
2004-11-23 00:00:00.000 22.11.2004 2004-11-22 14:50:00
2004-11-23 00:00:00.000 22.11.2004 2004-11-22 15:02:00
2004-11-23 00:00:00.000 22.11.2004 2004-11-22 15:03:00
2004-11-23 00:00:00.000 22.11.2004 2004-11-22 15:09:00
2004-12-09 00:00:00.000 09.12.2004 2004-12-09 08:09:00
Any help is very appreciated!
Thanks for your time & efforts!
Martin
Some but not all of the dates are incorrect converted (incremented by 1
day) with the following SQL statement.
SELECT DISTINCT CONVERT(datetim e,cast(Returned ByDate AS int)) AS
ReturnedByDate, CONVERT(varchar (10),ReturnedBy Date,104) AS
LabelReturnedBy Date, ReturnedByDate FROM i2b_keytransact ionhistory
ORDER BY ReturnedByDate ASC
'ReturnedByDate ' is of type smalldatetime in the table. I need the
result set to return me the ReturnByDate once as actual date values
(for the value of a dropdown) and once as text values (for the text of
the same dropdown). It all works fine, it's just that some actual date
values are incremented by one day. The third column in the result set
sample represents the actual database value as a reference to give you
an idea of the original value.
ReturnedByDate LabelReturnedBy Date ReturnedByDate
------------------------- ------------------- -------------------
2004-11-05 00:00:00.000 04.11.2004 2004-11-04 15:22:00
2004-11-11 00:00:00.000 11.11.2004 2004-11-11 00:00:00
2004-11-12 00:00:00.000 12.11.2004 2004-11-12 00:29:00
2004-11-22 00:00:00.000 21.11.2004 2004-11-21 20:23:00
2004-11-22 00:00:00.000 21.11.2004 2004-11-21 20:24:00
2004-11-22 00:00:00.000 21.11.2004 2004-11-21 21:10:00
2004-11-23 00:00:00.000 22.11.2004 2004-11-22 14:50:00
2004-11-23 00:00:00.000 22.11.2004 2004-11-22 15:02:00
2004-11-23 00:00:00.000 22.11.2004 2004-11-22 15:03:00
2004-11-23 00:00:00.000 22.11.2004 2004-11-22 15:09:00
2004-12-09 00:00:00.000 09.12.2004 2004-12-09 08:09:00
Any help is very appreciated!
Thanks for your time & efforts!
Martin
Comment