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 |
masterdineen
Aged Yak Warrior
550 Posts |
Posted - 2011-03-11 : 05:08:41
|
Hello thereI am trying to create a derived column into my ssis pack with the following requirementsI have a status date and want to look for dates that go from 9 days ago to the current day (getdate() )I am using the following syntax. but not sure where i am going wrong.ISNULL(STATUS_DATE) ? 0 : (YEAR(STATUS_DATE) == (DATEADD(day, DATEDIFF( day,0, GETDATE() ),0) -9) && GETDATE())? 1 : 0could someone point me in the right direction pleaseKind RegardsRobMCTS / MCITP certified |
|
latch
Yak Posting Veteran
62 Posts |
Posted - 2011-03-11 : 10:14:13
|
Hi,I assuming like these:if status_date has values like:03-21-201103-22-201103-02-201103-11-201103-02-201003-21-2009i am creating the derived column as :ISNULL(status) ? 0 : ((DATEDIFF("day",(dt_date)status,DATEADD("Day",-9,GETDATE()))) == 0 ? 1 : 0)if the incoming status_date equals to 9 days ago to today date thenresult column will be 1 else 0.001000Thanks,latch |
|
|
|
|
|