-1

whats wrong with this syntax,

I got this piece of expression:

(DT_I4)((DT_WSTR,4)YEAR(GETDATE()) + RIGHT(“0” + (DT_WSTR,2)MONTH(GETDATE()),2) + RIGHT(“0” + (DT_WSTR,2)DAY(GETDATE()),2))

The above was taken from this site:

https://dwbi1.wordpress.com/2012/05/26/how-to-populate-a-fact-table-using-ssis-part1/

But when I copy and paste it there is an error. Can someone please give me what it should have been. My knowledge of SSIS is limited and I don't understand where its going wrong

ɐlǝx
  • 1,384
  • 2
  • 17
  • 22
abs786123
  • 581
  • 2
  • 11
  • 24

1 Answers1

1

It's not necessary add (Dt_I4) because you have a cast error and your quotes (") are wrong,
try this:

(DT_WSTR,4) YEAR(getdate()) + RIGHT(  "0" + (DT_WSTR,2) MONTH(getdate()), 2)  +RIGHT( "0" + (DT_WSTR,2) DAY(getdate()), 2)

the result:

20161006

I hope this help.

ɐlǝx
  • 1,384
  • 2
  • 17
  • 22