Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
SQL
ce
clients
clustering
connect
datamining
datawarehouse
dts
fulltext
jdbcdriver
msde
mseq
newusers
notificationsvcs
odbc
olap
programming
replication
reportingsvcs
security
securitytools
server
setup
sqlxml.viewmapper
tools
xml
  
 
date: Thu, 28 Aug 2008 14:18:01 +0530,    group: microsoft.public.sqlserver.server        back       


i want to ignore the time aspect. Is there any parameters you can send to getdate() to specify return of just the date?   
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
date: Thu, 28 Aug 2008 14:18:01 +0530   author:   harshad

Re: i want to ignore the time aspect. Is there any parameters you can send to getdate() to specify return of just the date?   
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
> 
> 
>
date: Thu, 28 Aug 2008 10:06:13 +0100   author:   dave ballantyne

Re: i want to ignore the time aspect. Is there any parameters you can send to getdate() to specify return of just the date?   
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
> 
> 
>
date: Thu, 28 Aug 2008 11:08:41 +0200   author:   Tibor Karaszi

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us