Function: Format

Format takes a template string and 0 or more additional arguments which are then substituted into the template string. Because all values in terminal clauses within TQL are strings, this can be very useful when trying to generate values based on the output of other functions (such as dates & times).

The first template argument should be a string, with zero-based values surounded by curly braces representing each of the arguments to be subsituted:


Format(template, arg1, arg2... argN)


The below example will take the current day/month and form a new date string value based on their values and the year 2011 (Note: This is a rather naive example and will not work if the current date happens to be a leap day in a leap year).

EntityType = Incident AND CreatedAt >= Format('2010-{0}-{1}', DayOfDate(Today()), MonthOfDate(Today()))