Im trying to get the date part of the date column to compare two dates, but could not get date part directly, i tried this Convert(date, getdate())
but this does not work with sql server 2005 as we are using that, and when i tried DATEADD(dd, 0, DATEDIFF(dd, 0, GETDATE()))
it gives 2008-09-22 00:00:00.000
where i want only date part without time i-e 00,
taken both from the posts:
How to return the date part only from a SQL Server datetime datatype
What ihv done is convert(VARCHAR(10),'2014-04-21 00:00:00.000')
and it returns 2014-04-21
but it is now in varchar
.
Is there some way so that i may get the date part only in date type in sql server 2005.
Thanks in advance.