Archive

Archive for October, 2012

Get Date Only without Time of DateTime in SQL Server

October 14, 2012 Leave a comment

Hi all,

try this example to Get Date Only without Time of DateTime in SQL Server

select convert(datetime,convert(varchar,GETDATE(),101))

select DATEADD(dd,0, DATEDIFF(dd, 0, GETDATE()))

Hope this helps

Good Luck

Categories: SQL Server

Get Time Only from DateTime in SQL Server

October 14, 2012 Leave a comment

Hi all,

try this example to Get Time Only from Date Time in SQL Server


select Convert( VarChar( 10 ), GetDate(), 114 )

select CONVERT(VARCHAR,GETDATE(),108)

Hope this helps

Good Luck

Categories: SQL Server