将SQL日期字段轻松转换为mm / dd / yyy

时间:2019-06-19 21:41:45

标签: sql sql-server

在MS SQL Server中将三列转换为mm / dd / yyyy格式时遇到问题。

我在这里查看了许多方法,但是当我尝试实现它时,没有什么能奏效的。这是我要提取的一组非常基本的列。

SELECT 
[Incident_Number] 
,[Corporate_ID]
,[Assignee_Login_ID]
,select *, cast ([Submit_Date] as date) <TIME_CREATED> from SERVICEMGMT where date = 'mm/dd/yyyy' 
,[Last_Resolved_Date] as TIME_RESOLVED
,[Closed_Date] as TIME_CLOSED
,[Description]
 FROM [SERVICEMGMT].[dbo].[Help_Desk]
Where (corporate_id LIKE ('b%') AND TEMPLATE_NAME =  ('PC: Local Build/Deployment') AND STATUS > 3);

我收到一个基本的不正确语法错误。实际的错误消息是:

Msg 156, Level 15, State 1, Line 5 Incorrect syntax near the keyword 'select'.
Msg 102, Level 15, State 1, Line 6 Incorrect syntax near ','.

0 个答案:

没有答案