Task Factory Functions List T-Z

Tan

Tan

DescriptionReturns the tangent of the specified angle.
SyntaxTan( Numeric_Value )
ReturnsNumeric
Parameters
NameOptionalDescription
Numeric_ValuefalsePasses the values for which you want to the tangent of
Examples
Tan(55)
Tanh

Tanh

DescriptionReturns the hyperbolic tangent of the specified angle.
SyntaxTanh( Numeric_Value )
ReturnsNumeric
Parameters
NameOptionalDescription
Numeric_ValuefalsePasses the values for which you want to the tangent of
Examples
Tanh(55)
ToBigint

ToBigint

DescriptionConverts a value to a big int (Int64)
SyntaxToBigint( Value )
ReturnsInt64 value
Parameters
NameOptionalDescription
ValuefalseThe value to convert.
Examples
ToBigint(32), To_Big_Int(89090989)
ToChar

ToChar

DescriptionConverts a value to a string with optional formatting for date values
SyntaxToChar( Value [, Format] )
ReturnsString value
Parameters
NameOptionalDescription
ValuefalseThe value to convert.
FormatfalseThe formatting that will applied when the date value is converted. This is the equivalent of calling DateTime.ToString().
Examples
ToChar(32000), ToChar(Now(), "yyyy/MM/dd")
ToDate

ToDate

DescriptionConverts a string value to a date with optional formatting
SyntaxToDate( Value [, Format] )
ReturnsString value
Parameters
NameOptionalDescription
ValuefalseThe value to convert.
FormatfalseThe formatting that will applied when the date value is converted. This is the equivalent of calling DateTime.ToString().
Examples
ToDate("07/07/2012"), ToDate(Now(), "yyyy/MM/dd")
 Today

Today

DescriptionReturns the current date without the time.
SyntaxToday()
ReturnsDate
Examples
Today()
ToDecimal

ToDecimal

DescriptionConverts a value to a decimal value.
SyntaxToDecimal( Value [, Scale] )
ReturnsDecimal
Parameters
NameOptionalDescription
ValuefalseThe value to convert.
ScalefalseThe scale used to convert the decimal value.
Examples
ToDecimal("1234.78"), ToDecimal("45876.765", 2)
 ToFloat

ToFloat

DescriptionConverts a value to a float value.
SyntaxToFloat( Value )
ReturnsFloat
Parameters
NameOptionalDescription
ValuefalseThe value to convert.
Examples
ToFloat("1234.78")
ToInteger

ToInteger

DescriptionConverts a value to an integer value.
SyntaxToInteger( Value )
ReturnsInteger. Any decimal values will be rounded.
Parameters
NameOptionalDescription
ValuefalseThe value to convert.
Examples
ToInteger("1234.78")
 Token

Token

DescriptionSplits a string based on a delimeter.
SyntaxToken( Input_String, Delimeter, occurrence )
ReturnsString. If the input_string or delimeter is NULL, the function returns NULL.
Parameters
NameOptionalDescription
Input_StringfalseA string value that will be searched.
DelimeterfalseA delimeter to be used to split the value of Input_String.
OccurrencefalseThe occurrence that will be returned after the string has been split.
Examples
Token("400 College Dr|Middleburg|FL"|", 2) returns "Middleburg"
TokenCount

TokenCount

DescriptionGets the number of times a token occurs in a string.
SyntaxTokenCount( Input_String, Token )
ReturnsInteger. If the input_string or token is NULL, the function returns NULL.
Parameters
NameOptionalDescription
Input_StringfalseA string value that will be searched by the token value.
TokenfalseA string expression to be located in Input_String.
Examples
TokenCount("Sentry~44~One~55~Inc", "~")
Trim

Trim

DescriptionRemoves blanks or characters from the beginning and end of a string.
SyntaxTrim( String [, Trim_Set] )
ReturnsString. The string values with the specified characters in the trim_set argument removed. NULL if a value passed to the function is NULL. If the trim_set is NULL, the function returns NULL.
Parameters
NameOptionalDescription
StringfalseAny string value. Passes the strings you want to modify. You can enter any valid task editor. Use operators to perform comparisons or concatenate strings before removing characters from the beginning of a string.
Trim_SettrueAny string value. Passes the characters you want to remove from the beginning of the first string. You can enter any valid task editor. You can also enter a character string. However, you must enclose the characters you want to remove from the beginning of the string within single quotation marks, for example, 'abc'. If you omit the second string, the function removes any blanks from the beginning and end of the string. Trim is case sensitive. For example, if you want to remove the 'A' character from the string 'Alfredo', you would enter 'A', not 'a'.
Examples
Trim(" SentryOne "), Trim(CompanyNameColumn), Trim("----SentryOne", "-")
Trunc(Date)

Trunc(Date)

DescriptionTruncates date to a specific year, month, day, hour, minute, second, millisecond, or microsecond.
SyntaxTrunc( Date [, Format])
ReturnsDate.
Parameters
NameOptionalDescription
DatefalseThe value to add to the aggregation
FormattrueAnything after this part will be reset to default value. e.g. if you pass HH then anything after Hour (e.g. Minute, Second, Milliseconds) will be reset to 0. Valid format specifiers Year = "Y", "YY", "YYY", "YYYY"<br /> Day = "D", "DD", "DDD", "DY", "DAY"<br /> Month = "M", "MM", "MON", "MONTH"<br /> Hour = "H", "HH", "HH12", "HH24"<br /> Minute = "MI"<br /> Second = "S", "SS""<br /> Millisecond = "MS"<br /> Microsecond = "US"
valuefalsenew value for specified date part.
Examples
SetDatePart(Now(),"D", 1)
Trunc(Number)

Trunc(Number)

DescriptionTruncates specified decimal places from numeric value.
SyntaxTrunc( Number [, Precision])
ReturnsNumber.
Parameters
NameOptionalDescription
NumberfalseThe number you want to truncate
PrecisiontrueNumber of decimal places to keep. If you pass 0 then all digits after decimal point will be truncated. If you pass -ve precision number then it will truncate digits before decimal point.
Examples
Trunc(567.7789,2) --> 567.7700 Trunc(567.7789) --> 567.0000 Trunc(567.7789,-2) --> 500.0000
TryEval

TryEval

DescriptionReturns defaultvalue if supplied expression fails to execute. This function help to continue execution on error and it behaves like Try..Catch construct provided in other programming languages such as VB.net/C#.
SyntaxTryEval( expression, defaultvalue [, logerrors] )
ReturnsReturns result of main expression if succueed else returns defaultvalue.
Parameters
NameOptionalDescription
expressionfalseAny valid expression (without compiler error). E.g. MyCol/0 is valid expression but produce "Divide By Zero" error at runtime.
defaultvaluefalseAny valid expression or value which can be returned when main expression fails.
logerrorstrueBoolean value indicating whether error message should be logged or not. If this argument is True (which is default setting) then error messages will appear in you ssis package execution log as Information icon [e.g. <<EVAL-ERROR at="" ROW=""# 234="">> some error occurred].
Examples
TryEval(TO_CHAR("1")/TO_CHAR("0") , -999 ) -- Returns -999 becuase TO_CHAR("1")/TO_CHAR("0") fails with DivideByZero error TryEval(TO_DATE("55/12/1231","MM/DD/YYYY"), GETDATE() ) -- Returns today's date if date parsing fails
Upper

Upper

DescriptionConverts lowercase string characters to uppercase.
SyntaxUPPER( String )
ReturnsUppercase string. If the data contains multibyte characters, the return value depends on the code page and data movement mode of the Integration Service. NULL if a value passed to the function is NULL.
Parameters
NameOptionalDescription
StringfalseString datatype. Passes the values you want to change to uppercase text. You can enter any valid task editor.
Examples
Upper("this will be uppercase now"), IIF(Upper(FirstNameColumn) = "CHRIS", 1, 0)
WeekOfYear

WeekOfYear

DescriptionReturns the week number of the year of the date specified.
SyntaxWeekOfYear( Date )
Returnsreturns integer value of 1 - 52
Parameters
NameOptionalDescription
DatefalseDate to retrieve week of year from
Examples
WeekOfYear("12/8/2011"), WeekOfYear(varDate), WeekOfYear(OrderDateColumn)
Year

Year

DescriptionReturns the Year from the date specified.
SyntaxYear( Date )
Returnsreturns integer value of year
Parameters
NameOptionalDescription
DatefalseDate to retrieve Year from
Examples
Year("12/8/2011"),Year(varDate), Year(OrderDateColumn)