比较存储过程中的日期时间 [英] compare datetime in stored Procedure
本文介绍了比较存储过程中的日期时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在存储过程中工作,因为我想将一个特定日期的日期值设置为null,另一个日期与时间分开
任何人请Rply
在Advance中感谢
I m working in stored procedure in that the date value of a particular date i want to set null and another date seprate with time
any one pls Rply
Thanks in Advance
推荐答案
您可以将空值设置为允许允许为空的任何列
像Set @pdate = null
您可以使用
将日期与时间分开
选择convert(varchar(10),getdate(),105)函数
使用101到112作为您的垂直格式.
希望这对您有所帮助.:thumbsup:
you can set null value to any column iff it allows null
like Set @pdate = null
and you can seperate date from time by using
Select convert(varchar(10),getdate(), 105) function
use 101 to 112 for your perticular format.
Hope this helps you.:thumbsup:
您标记了问题C#,但希望获得有关SQL的帮助.因此,我们不知道您使用的是哪个数据库,但是我们知道C#代码不是答案,除非问题措辞很差.也许您应该阅读数据库随附的书籍,并查找datediff类型的函数?
You tagged your question C#, yet you want help with SQL. As such, we have no idea what database you''re using, but we know that C# code is not the answer, unless the question is very badly worded. Perhaps you should read the books that came with your database and look for datediff type functions ?
这篇关于比较存储过程中的日期时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文