June 15, 2018 at 7:18 am
I know this will be easy for most, but for me I have tried a few things that are not working. I have this from a prior job and just modified for this one in the connection string expression:
"POMAROAK" + RIGHT("0" + (DT_WSTR,2)DATEPART("mm",GetDate()) ,2) + RIGHT("0" + (DT_WSTR,2)DATEPART("dd",GetDate()),2) + (DT_WSTR,4)DATEPART("yy",GetDate())+ ".txt"
I need to take that yy DATEPART and return only the two digit year.
Thanks
UPDATE: As usual after I ever post something, I solve my own problem. And this is the answer to the two year digit dilemma: RIGHT("0" + (DT_WSTR,4)DATEPART("yy",GetDate()),2)
June 15, 2018 at 8:40 am
Brad Allison - Friday, June 15, 2018 7:18 AMI know this will be easy for most, but for me I have tried a few things that are not working. I have this from a prior job and just modified for this one in the connection string expression:"POMAROAK" + RIGHT("0" + (DT_WSTR,2)DATEPART("mm",GetDate()) ,2) + RIGHT("0" + (DT_WSTR,2)DATEPART("dd",GetDate()),2) + (DT_WSTR,4)DATEPART("yy",GetDate())+ ".txt"
I need to take that yy DATEPART and return only the two digit year.
Thanks
UPDATE: As usual after I ever post something, I solve my own problem. And this is the answer to the two year digit dilemma: RIGHT("0" + (DT_WSTR,4)DATEPART("yy",GetDate()),2)
Do you really need to prepend the "0" before taking the RIGHT of the DATEPART? I haven't used SSIS in quite awhile and don't have the SSIS available at the moment to test.
June 15, 2018 at 9:06 am
Brad Allison - Friday, June 15, 2018 7:18 AMUPDATE: As usual after I ever post something, I solve my own problem. And this is the answer to the two year digit dilemma: RIGHT("0" + (DT_WSTR,4)DATEPART("yy",GetDate()),2)
Or this, which doesn't need character conversions:DATEPART("yy",GetDate())%100
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy