sql server convert date to string MM/DD/YYYY

前端 未结 5 1598
误落风尘
误落风尘 2020-11-27 20:14

I am using SQL Server 2008.

I have the following:

    select convert(varchar(20),fmdate) from Sery

How do I convert the date to str

5条回答
  •  我在风中等你
    2020-11-27 20:27

    That task should be done by the next layer up in your software stack. SQL is a data repository, not a presentation system

    You can do it with

    CONVERT(VARCHAR(10), fmdate(), 101)
    

    But you shouldn't

提交回复
热议问题