How to convert int to date in SQL Server 2008

前端 未结 5 934
情歌与酒
情歌与酒 2020-12-09 18:50

I am using MS SQL Server 2008, and in a table I have column idate as date but in the integer format. But in the query I want that in the date format. Is it possible to conve

5条回答
  •  一个人的身影
    2020-12-09 19:45

    You most likely want to examine the documentation for T-SQL's CAST and CONVERT functions, located in the documentation here: http://msdn.microsoft.com/en-US/library/ms187928(v=SQL.90).aspx

    You will then use one of those functions in your T-SQL query to convert the [idate] column from the database into the datetime format of your liking in the output.

提交回复
热议问题