Sometimes, you would want to obtain only the ‘date’ part of a SQL datetime timestamp column.
Normally, your datetime column will hold dates in the following format.
You can do the following to remove its time section
SELECT CAST(YourColumnName AS varchar(12)) AS DesiredColumnName from YourTableName where YourColumnName > ’2012/05/01′
This will result in the following
Feb 21 2002
It renders date in a more readable format, great when presenting dates on your website using either GridView or Repeater control.
Hope this is helpful.