Which expression would produce the last day of the month, 3 years ago from today, with a 4-digit year and a 3-letter month abbreviation?

Prepare for the Tricentis Tosca Automation Specialist Level 1 (AS1) Test. Enhance your skills with multiple choice questions and explanations. Be exam ready!

Multiple Choice

Which expression would produce the last day of the month, 3 years ago from today, with a 4-digit year and a 3-letter month abbreviation?

Explanation:
When Tosca constructs a date string, you combine two ideas: adjusting the date and deciding how to display it. The function here moves the date back three years from today and keeps the same month, then asks Tosca to render that date in a specific text format. MONTHLAST returns the last day of the month for the date produced by the rest of the expression. The modifier [-3y] shifts today by minus three years, so you’re looking at the last day of the same month, three years ago. The formatting part then decides how that date appears as text. Using MMMyyyy tells Tosca to write the month as a three-letter abbreviation (MMM) followed immediately by the four-digit year (yyyy) with no space, producing strings like Jan2021 or Mar2024. This precisely matches the requirement of a 3-letter month abbreviation and a 4-digit year without any separator. Using a format with a space between the month and year would produce things like Jan 2021, which doesn’t meet the exact formatting asked for here. Hence the expression using MMMyyyy is the best fit.

When Tosca constructs a date string, you combine two ideas: adjusting the date and deciding how to display it. The function here moves the date back three years from today and keeps the same month, then asks Tosca to render that date in a specific text format.

MONTHLAST returns the last day of the month for the date produced by the rest of the expression. The modifier [-3y] shifts today by minus three years, so you’re looking at the last day of the same month, three years ago. The formatting part then decides how that date appears as text. Using MMMyyyy tells Tosca to write the month as a three-letter abbreviation (MMM) followed immediately by the four-digit year (yyyy) with no space, producing strings like Jan2021 or Mar2024. This precisely matches the requirement of a 3-letter month abbreviation and a 4-digit year without any separator.

Using a format with a space between the month and year would produce things like Jan 2021, which doesn’t meet the exact formatting asked for here. Hence the expression using MMMyyyy is the best fit.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy