Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

SSIS expression: get previous date in yyyy-mm-dd

$
0
0

Hi, 

For the syntax below, i got 2018-09-17

(DT_STR,4,1252)DATEPART( "yyyy" , getdate() ) +  "-" +
RIGHT("0" + (DT_STR,4,1252)DATEPART( "mm" , getdate() ), 2) +  "-" +
RIGHT("0" + (DT_STR,4,1252)DATEPART( "dd" , getdate() ), 2)

get previous date, I have  -1 but got error, not sure why?

(DT_STR,4,1252)DATEPART( "yyyy" , getdate() ) +  "-" +
RIGHT("0" + (DT_STR,4,1252)DATEPART( "mm" , getdate() ), 2) +  "-" +
RIGHT("0" + (DT_STR,4,1252)DATEPART( "dd" , getdate()-1 ), 2)

Thanks


Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>