Showing posts with label expression. Show all posts
Showing posts with label expression. Show all posts

Wednesday, March 28, 2012

Renaming a file with File System task

I'm having trouble working this out in SSIS. I am trying to use a File System task to rename a file using an expression so that file.zip will be renamed to filemmyy.zip at the end of every month (for instance this month would be file0506.zip).

I am using the destination expression variable. But I'm not sure what to put for DestinationConnection. It seems to want a file name, but the file name is going to be variable, so I'm not sure what to put.

Any ideas?

If you change the IsDestinationPathVariable to be True, then DestinationConnection expects a variable. Select the variable created previously that has the expression on it.|||

What would the variable be called? Under the expressions part of the File System Task editor I have Destination and the expression is "TestExpression.txt".

So would my variable be User::Destination, or something else?

sql

Monday, March 26, 2012

Rename SQL Bit in Reporting services

Hello,

What is the best way to rename a bit "True/False" to "Open/Closed" or "yes/no" in the expression editior.

Thanks

B

What a simple answer...

=iif(Fields!Fieldname.Value = 0 , "No" , "Yes")

I think sql somehow translates the 0 to a false...

Saturday, February 25, 2012

Removing Characters in Field grouping

Hello,

I am using the following expression to strip the last 11 characters in a field group and it returns an error saying that Len cannot use a negative number. It must be 0 or greater. Is there a better alternative?

Code Snippet

left(Fields!TestName.Value,len(Fields!TestName.Value)-11))

you can use Rtrim|||

Are you always removing 11 character regardless of the field length or do you simply want to restrict it to a certain size?

For example, the following code restricts the length to 5 characters:

=iif(len(rtrim(Fields!TestDATA.Value)) > 5, mid(rtrim(Fields!TestDATA.Value),1,5), rtrim(Fields!TESTDATA.Value))