Combining (concatenating) date and time into a datetime

后端 未结 12 975
夕颜
夕颜 2020-12-08 15:06

Using SQL Server 2008, this query works great:

select CAST(CollectionDate as DATE), CAST(CollectionTime as TIME)
from field

Gives me two co

12条回答
  •  孤城傲影
    2020-12-08 15:07

    Concat date of one column with a time of another column in MySQL.

    SELECT CONVERT(concat(CONVERT('dateColumn',DATE),' ',CONVERT('timeColumn', TIME)), DATETIME) AS 'formattedDate' FROM dbs.tableName;
    

提交回复
热议问题