我想问一下如何从SQL Server查询中的DateTime
列中获取 MIN DatePart。Select
这是我的查询:
SELECT
MIN(CAST(DATEPART(DD, DateCreated) AS NVARCHAR) +
N'/' +
CAST(DATEPART(MM, DateCreated) AS NVARCHAR) +
N'/' +
CAST(DATEPART(YYYY, DateCreated) AS NVARCHAR)) AS DateFrom
FROM
[User]
结果应该是04/04.2013
,但现在,结果是01/04/2014
请帮忙 ....