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
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 View with date

Author  Topic 

ilimax
Posting Yak Master

164 Posts

Posted - 2009-07-29 : 15:52:45
I want to create view and I have column with date ... There is full date-time format saved.
I want to pull data from table with today date.
How I can say in view filter today date?

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-07-29 : 16:42:30
WHERE Col1 >= DATEADD(DAY, DATEDIFF(DAY, 0, GETDATE()), 0)
AND Col1 < DATEADD(DAY, DATEDIFF(DAY, 0, GETDATE()), 1)



N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page

ilimax
Posting Yak Master

164 Posts

Posted - 2009-07-29 : 18:10:35
Thanks
Go to Top of Page
   

- Advertisement -