Change Date Format(DD/MM/YYYY) in SQL SELECT Statement

前端 未结 5 1084
挽巷
挽巷 2021-02-08 08:28

The Original SQL Statement is:

SELECT SA.[RequestStartDate] as \'Service Start Date\', 
       SA.[RequestEndDate] as \'Service End Date\', 
FROM
(......)SA
WHER         


        
5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-08 08:48

    Changed to:

    SELECT FORMAT(SA.[RequestStartDate],'dd/MM/yyyy') as 'Service Start Date', SA.[RequestEndDate] as 'Service End Date', FROM (......)SA WHERE......
    

    Have no idea which SQL engine you are using, for other SQL engine, CONVERT can be used in SELECT statement to change the format in the form you needed.

提交回复
热议问题