January 24, 2008 at 3:01 pm
I am trying to create an expression in ssis as follows:
"capp"+(DT_STR,4,1252) DatePart("yy",getdate()) +
Right("0" + (DT_STR,2,1252) DatePart("m",getdate()),2) +
Right("0" + (DT_STR,2,1252) DatePart("d",getdate()),2) + ".txt"
Displays
capp20080124.txt
What I want is capp080124.txt and I not sure how to get the year to be two digits and not four? Please help..
November 15, 2013 at 2:44 pm
Replace
(DT_STR,4,1252) DatePart("yy",getdate())
with
Right((DT_STR, 4, 1252)DatePart("yyyy", getdate()), 2)
This will return the last two (Right) digits of the year (ignoring the "20" century).
November 18, 2013 at 5:11 am
alane 46264 (11/15/2013)
Replace(DT_STR,4,1252) DatePart("yy",getdate())
with
Right((DT_STR, 4, 1252)DatePart("yyyy", getdate()), 2)
This will return the last two (Right) digits of the year (ignoring the "20" century).
You just answered a five-year-old post - hope that they were not sitting there waiting! 😀
The absence of evidence is not evidence of absence.
Martin Rees
You can lead a horse to water, but a pencil must be lead.
Stan Laurel
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply