Dear All, I want to compare a date with a getDate() the problem is that the getDate() returns the time too... hence 1/1/2004 >= 1/1/2004 13:21 is false... hence 1/1/2004 >= 1/1/2004 is true... i want to ignore the time aspect. Is there any parameters you can send to getdate() to specify return of just the date? Thanks harshad prajapati
Hi , you cant 'ignore' time as it is an integral part of a datetime variable. The best way to set the time to midnight today would be SELECT DATEDIFF(DAY,0,GetDate()) Dave harshad wrote: > Dear All, > > I want to compare a date with a getDate() > > the problem is that the getDate() returns the time too... > hence 1/1/2004 >= 1/1/2004 13:21 is false... > hence 1/1/2004 >= 1/1/2004 is true... > > i want to ignore the time aspect. Is there any parameters you can send to > getdate() to specify return of just the date? > > Thanks > > harshad prajapati > > >
http://www.karaszi.com/SQLServer/info_datetime.asp#Searching -- Tibor Karaszi, SQL Server MVP http://www.karaszi.com/sqlserver/default.asp http://sqlblog.com/blogs/tibor_karaszi "harshad" wrote in message news:OTq0IrOCJHA.1180@TK2MSFTNGP04.phx.gbl... > Dear All, > > I want to compare a date with a getDate() > > the problem is that the getDate() returns the time too... > hence 1/1/2004 >= 1/1/2004 13:21 is false... > hence 1/1/2004 >= 1/1/2004 is true... > > i want to ignore the time aspect. Is there any parameters you can send to > getdate() to specify return of just the date? > > Thanks > > harshad prajapati > > >