SSIS Tips: Watch Your Variables!

Who is online?  0 guests and 0 members
Home  »  Blogs  »  ShawnHarrison  »  SSIS Tips: Watch Your Variables!
user505380 likes this.
 
0
/5
Avg: 0/5: (0 votes)

Comments (3)

stevergee
stevergee said:
Shawn - is there a simple way to get a 3 Character Mon value Like: "DEC" using the Month(Getdate()) functions in SSIS? this will return a integer 12 - but how do I get that to go to a "DEC" string? Thanks Stever
12/21/2011
 · 
 
by
stevergee
stevergee said:
I just discovered that this will work: (DT_WSTR, 2) MONTH( GETDATE() )=="12" ? "DEC" : (DT_WSTR, 2) MONTH( GETDATE() )=="11" ? "NOV" : (DT_WSTR, 2) MONTH( GETDATE() )=="10" ? "OCT" : (DT_WSTR, 2) MONTH( GETDATE() )=="9" ? "SEP" : (DT_WSTR, 2) MONTH( GETDATE() )=="8" ? "AUG" : (DT_WSTR, 2) MONTH( GETDATE() )=="7" ? "JUL" : (DT_WSTR, 2) MONTH( GETDATE() )=="6" ? "JUN" : (DT_WSTR, 2) MONTH( GETDATE() )=="5" ? "MAY" : (DT_WSTR, 2) MONTH( GETDATE() )=="4" ? "APR" : (DT_WSTR, 2) MONTH( GETDATE() )=="3" ? "MAR" : (DT_WSTR, 2) MONTH( GETDATE() )=="2" ? "FEB" : "JAN"
12/21/2011
 · 
 
by
stevergee
stevergee said:
This will work also if you need to grab the next month: (DT_WSTR, 2) (MONTH( GETDATE()) + 1) =="13" ? "JAN" : (DT_WSTR, 2) (MONTH( GETDATE()) + 1) =="12" ? "DEC" : (DT_WSTR, 2) (MONTH( GETDATE()) + 1) =="11" ? "NOV" : (DT_WSTR, 2) (MONTH( GETDATE()) + 1) =="10" ? "OCT" : (DT_WSTR, 2) (MONTH( GETDATE()) + 1) =="9" ? "SEP" : (DT_WSTR, 2) (MONTH( GETDATE()) + 1) =="8" ? "AUG" : (DT_WSTR, 2) (MONTH( GETDATE()) + 1) =="7" ? "JUL" : (DT_WSTR, 2) (MONTH( GETDATE()) + 1) =="6" ? "JUN" : (DT_WSTR, 2) (MONTH( GETDATE()) + 1) =="5" ? "MAY" : (DT_WSTR, 2) (MONTH( GETDATE()) + 1) =="4" ? "APR" : (DT_WSTR, 2) (MONTH( GETDATE()) + 1) =="3" ? "MAR" : (DT_WSTR, 2) (MONTH( GETDATE()) + 1) =="2" ? "FEB" : "JAN"
12/21/2011
 · 
 
by
user922899
user922899 said:
or... SubString("JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC",((MONTH(GETDATE())-1) * 3)+1,3)
3/13/2012
 · 
 
by
stevergee
stevergee said:
Type casting the value of the Month() Function as a string in a conditional question block to return the 3 Char month designation. Thanks! :) Stever
12/21/2011
 · 
 
by
ShawnHarrison
ShawnHarrison said:
Excellent! Thanks for the info. I was just about to start playing with that idea until you posted these.
12/21/2011
 · 
 
by
Blogs RSS Feed

ShawnHarrison's latest blog posts

Blogs RSS Feed

Latest community blog posts