Tuesday, May 6, 2008

using convert function filter time or date only from datetime column

SELECT

 



convert(char(11), getdate(),109)

May  6 2008
SELECT

 



convert(char(8), getdate(),108)

12:51:32

and so on u can change according input different char length and style value

1 comment :

  1. i want to change year in date field in sql 2005

    ReplyDelete

AJAX, asp, Asp.net, asp.net and sql server security, Asp.net IntemIndex, C#, Css, DataBinder.Eval, DataKeyNames, Datalist, Datapager, DataSet, DataTable, DropDownList, FindControl, gridview, JavaScript, jquery, Listview, Paging, Regex, RegularExpression, Repeater, Server side validation, Sql Server, timer, timercallback, Validation, XML, xmlnode, XPath