在表格的任何日期列中,还显示日期时间以及如何避免时间 [英] in any date column in table,along with date time is also displayed how to avoid the time

查看:98
本文介绍了在表格的任何日期列中,还显示日期时间以及如何避免时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hii,我有一个要求,就是我想在运行时将表中的Modify_date列与传递的date参数进行比较,但是modify_date列是带有日期和时间的,所以没有得到预期的结果,只有某种方式可以将日期设置为这些内容可能对我有帮助吗?
在此先感谢;;;;;;;;;

hii,i have a requirement such that i want to compare the modify_date column in table with passing date parameter at runtime,but modify_date column is with date & time so am not getting expected result is there any way only the date should be available in modify_date column & drop time ...............is these possible pls help me
thanks in advance;;;;;;;;;

推荐答案

检查此

http://stackoverflow. com/questions/353014/convert-sql-server-datetime-fields-to-compare-date-parts-only-with-indexed-look [ http://blog .sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/ [
Check this

http://stackoverflow.com/questions/353014/convert-sql-server-datetime-fields-to-compare-date-parts-only-with-indexed-look[^]

http://blog.sqlauthority.com/2007/06/10/sql-server-retrieve-select-only-date-part-from-datetime-best-practice/[^]


检查此内容:

Check this:

select cast(GETDATE() as varchar(12));


u只能从datetime获取日期,因为:
u can get only date from datetime as:
SELECT CONVERT(VARCHAR(10),GETDATE(),111)


有关更多日期时间格式的转换,请参考:
http://msdn.microsoft.com/en-us/library/ms187928.aspx [ ^ ]


for more datetime format conversions refer:
http://msdn.microsoft.com/en-us/library/ms187928.aspx[^]


这篇关于在表格的任何日期列中,还显示日期时间以及如何避免时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆