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.
Author |
Topic |
sr832
Starting Member
2 Posts |
Posted - 2010-08-27 : 17:22:09
|
I am trying to get the data only yesterday's data. Its working through management Studio but SSIS is not workingselect * FROM TableWHERE datefield >= GETDATE() - 2in SSIS select * from table where (Datefield = { d '2010-08-26' }) - working but not able to get yesterday's date.I am new to SQL server and SSIS, can any one please help me on this. |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-08-28 : 02:18:17
|
[code]select * FROM TableWHERE datefield >=DATEADD(dd,DATEDIFF(dd,0,GETDATE())-1,0)AND datefield <DATEADD(dd,DATEDIFF(dd,0,GETDATE()),0)[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
sr832
Starting Member
2 Posts |
Posted - 2010-08-30 : 13:54:01
|
Actually this query working in Management Studio; select * from table WHERE (CONVERT(Varchar, EventDate, 101) > GETDATE() - 2) AND (CONVERT(Varchar, EventDate, 101) < GETDATE() - 1)but i tried yours in SSIS, its not working. The Datefield (Eventdate data type is a DateTime |
|
|
|
|
|
|
|