Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Todays date

Author  Topic 

Leo_Don
Starting Member

42 Posts

Posted - 2008-11-05 : 04:05:38
Hi Experts,

I need a Query where i can extract the data from the tabe depending on todays date

like will this work

SELECT * FROM table T0 WHERE DocDate <= SYSDATETIME

Thanx in advance

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-11-05 : 04:06:50

SELECT * FROM table T0 WHERE DocDate <= GETDATE()

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Leo_Don
Starting Member

42 Posts

Posted - 2008-11-05 : 04:11:41
Thanx You
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-11-05 : 04:18:00
SELECT * FROM table T0 WHERE DocDate <= DATEADD(dd,DATEDIFF(dd,0,GETDATE()),0)
Go to Top of Page
   

- Advertisement -