How do I retrieve a date from SQL Server in YYYY-MM-DD
format?
(如何以YYYY-MM-DD
格式从SQL Server检索日期?)
I need this to work with SQL Server 2000 and up. (我需要这个与SQL Server 2000及更高版本一起工作。)
Is there a simple way to perform this in SQL Server or would it be easier to convert it programmatically after I retrieve the result set? (有没有一种简单的方法在SQL Server中执行此操作,还是在检索结果集后以编程方式更容易地进行转换?)
I've read the CAST and CONVERT on Microsoft Technet, but the format I want isn't listed and changing the date format isn't an option.
(我已阅读Microsoft Technet上的CAST和CONVERT ,但未列出我想要的格式,并且不能更改日期格式。)
ask by Kinze translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…