我想将 DateTime 变量转换为日期和时间分隔的变量。我已经尝试过这个 SQL 查询,但它不起作用。
答案 0 :(得分:0)
假设您的数据库是 sql server,而不是 mysql,您可以通过这样的查询获得这 2 个值:
select
convert(date, dateTimeDepartureOutbound__c) as thedate,
convert(time, dateTimeDepartureOutbound__c) as thetime
from Order_DE
如果你真的使用 mysql,一个选项可能是这个:
select
date(dateTimeDepartureOutbound__c) as thedate,
time(dateTimeDepartureOutbound__c) as thetime
from Order_DE
答案 1 :(得分:0)
对于 SQL Server
选择 CAST(