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 2008 Forums
 SSIS and Import/Export (2008)
 expression to get the last year derived column

Author  Topic 

shanmugaraj
Posting Yak Master

219 Posts

Posted - 2014-08-04 : 06:58:24
Need have the expression to get the last year same month of the getdate() in derived column

I am trying with

(DT_STR,4,1252)DATEPART("yyyy",GETDATE()) + RIGHT("0" + (DT_STR,2,1252)DATEPART("mm",GETDATE()),2)

current result 201408
expected result 201308

THANKS
SHANMUGARAJ
nshanmugaraj@gmail.com

shanmugaraj
Posting Yak Master

219 Posts

Posted - 2014-08-04 : 08:06:48
(DT_STR,4,1252)(DATEPART("yyyy",GETDATE()) - 1) + RIGHT("0" + (DT_STR,2,1252)DATEPART("mm",GETDATE()),2)


THANKS
SHANMUGARAJ
nshanmugaraj@gmail.com
Go to Top of Page
   

- Advertisement -