在执行我的查询时,我收到以下错误消息“从字符串转换日期和/或时间时转换失败”是我的查询。
select OrderLog_Initiated, OrderLog_SessionDateTime
into #FullMemberOrderLog
from tbl_orderlog
where CONVERT(date,OrderLog_Initiated) between '2013-03-03' and '2013-03-08' -- order by OrderLog_Initiated
insert into #FullMemberOrderLog
select OrderLog_Initiated, OrderLog_SessionDateTime
from tbl_orderlog
where CONVERT(date,OrderLog_Initiated) between '2013-03-03' and '2013-03-08'
select #result = (cast(DATEDIFF(HOUR,CONVERT(date,'OrderLog_Initiated'),CONVERT(date,'OrderLog_SessionDateTime' )) as float) ) from #FullMemberOrderLog
请有人在这个问题上帮助我,真的我在煎炸......我的预期结果是将“OrderLog_Initiated”表与“OrderLog_SessionDateTime”表进行比较,并提供以小时为单位的时差,但我无法得到我的预期。请有人帮助我,非常感谢您提前。