Skip to content

TRUNC

  • x: The numeric or date value that is to be truncated or rounded down. It can be a field or an expression that evaluates as a value. If a date is provided, it is truncated to the specified date part.
  • d: An optional parameter that defines the number of decimal places to which the number X should be truncated. For dates, D determines the level of precision (e.g., year, month, day, etc.). If left empty, numbers default to 0 decimal places and dates default to the day value.
SELECT TRUNC(123.456, 1);
123.4

The TRUNC function is used to truncate a number to a certain number of decimal places specified as the second argument. In the given example, TRUNC(123.456, 1) truncates the number 123.456 to 1 decimal place, resulting in 123.4.