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

前端 未结 5 1087
挽巷
挽巷 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条回答
  •  孤街浪徒
    2021-02-08 08:54

    You will want to use a CONVERT() statement.

    Try the following;

    SELECT CONVERT(VARCHAR(10), SA.[RequestStartDate], 103) as 'Service Start Date', CONVERT(VARCHAR(10), SA.[RequestEndDate], 103) as 'Service End Date', FROM (......) SA WHERE.....
    

    See MSDN Cast and Convert for more information.

提交回复
热议问题