SQL SERVER 2005及更高版本LANGuage使用c#.net [英] SQL SERVER 2005 & LANGuage use c#.net
本文介绍了SQL SERVER 2005及更高版本LANGuage使用c#.net的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在SQL Server中以特定格式创建DateTime
How do you create a DateTime in a specific format in SQL Server
推荐答案
DateTime没有格式:自从任意时间点.
您可以使用 SQL FORMAT函数 [
A DateTime does not have a format: it is stored as a a number of microseconds since an arbitrary point in time.
You can use the SQL FORMAT function[^] to do it, but I don''t recommend it - it is much better to return a DateTime value and then format it for display at the last moment. If you format it in SQL, then you are fixing the format to one which may not be what the user is used to: if he normally gets US format, then European is not helpful. If he expects European and gets Japanese, it is also a pain.
谢谢你
我只想存储日期而没有时间
在表单中,我在代码中使用fromat日期,但在商店中使用日期和时间
你能帮忙
thank you
I want to store date only without time
in the form I am use the fromat date in the code but the store date and time
can you help
这篇关于SQL SERVER 2005及更高版本LANGuage使用c#.net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文