Tech Talk A software developer on all things tech, and then some

9Jun/140

Shorthand Month in SSIS Expression

Need a quick way to get the shorthand version (Mmm) of a month in a SSIS expression? Copy and paste the following into a variable and you have precisely just that.

MONTH(GETDATE()) == 1 ? "Jan" : 
MONTH(GETDATE()) == 2 ? "Feb" :
MONTH(GETDATE()) == 3 ? "Mar" :
MONTH(GETDATE()) == 4 ? "Apr" :
MONTH(GETDATE()) == 5 ? "May" :
MONTH(GETDATE()) == 6 ? "Jun" :
MONTH(GETDATE()) == 7 ? "Jul" :
MONTH(GETDATE()) == 8 ? "Aug" :
MONTH(GETDATE()) == 9 ? "Sep" :
MONTH(GETDATE()) == 10 ? "Oct" :
MONTH(GETDATE()) == 11 ? "Nov" :"Dec"

A quick code snippet to hopefully save you a couple of minutes of typing.

Happy Coding!

Comments (0) Trackbacks (0)

No comments yet.


Leave a Reply

No trackbacks yet.

%d bloggers like this: