从日期时间中删除时间 [英] Removal of time from datetime

查看:102
本文介绍了从日期时间中删除时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨..我使用数据类型作为datetime来使用出生日期..在设计中我使用ajax日历扩展器输入文本框。现在插入数据库后我得到输出为2012-07-09 00:00:00.000 ..我需要帮助从这个专栏中删除时间..请提供解决方案。



问候

sarthi

解决方案

为什么不转换你的日期时间像

选择CONVERT(VARCHAR(8), current_timestamp,5)AS TodayDate 



将您的DateOf出生地代替current_timestamp


生成出生日期的数据类型为日期而不是 DateTime ...

Hi.. i hav used date of birth with datatype as datetime.. and in design i am inputting textbox using ajax calendar extender.. Now after inserting to database i am getting the output as 2012-07-09 00:00:00.000.. I needed help in removal of time from this column.. please provide the solution.

Regards
sarthi

解决方案

Why Dont You Convert your DateTime like

select CONVERT(VARCHAR(8),  current_timestamp, 5) AS TodayDate


Place your DateOf Birth Field in place of current_timestamp


Make date of birth''s datatype as Date instead of DateTime...


这篇关于从日期时间中删除时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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