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
 SSIS and Import/Export (2005)
 Last date of every month

Author  Topic 

sanjepau
Starting Member

5 Posts

Posted - 2009-07-23 : 11:04:47
Hi All,

Can anyone please let me know the expression we need to write in Derived column of SSIS package to get the last date of every month.


Any help will be highly appreciated.

Regards
Sanjeev

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2009-07-23 : 12:35:46
Will u expect like this


declare @i int
set @i=1
while @i<=12
begin
SELECT DAY(DATEADD(d, -DAY(DATEADD(m,1,cast(cast(@i as varchar(2))+'-01-2009' as datetime))),DATEADD(m,1,cast(cast(@i as varchar(2))+'-01-2009' as datetime))))
set @i=@i+1
end

Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled

http://senthilnagore.blogspot.com/
Go to Top of Page
   

- Advertisement -