Quick Search:
CODE
Oracle PL/SQL Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
 The Oracle TRUNC Function      [Return To Index] Jump to:  
  Looking for the original pages? (formerly called "Morgan's Library") You can find them here.

Term: TRUNC

Definition:
The TRUNC function truncates either a number or a datetime value. The syntax of the TRUNC function is different depending on the whether it is being used for a number or a date and time value.

TRUNC (datetime)
The TRUNCATE (datetime) function returns date with the time portion of the day truncated to the unit specified by the format model.

TRUNC(datetime_exp, [fmt]);


The [fmt] parameter is the format that indicates how the date and time number should be truncated. If you omit fmt, then date is truncated to the nearest day.

TRUNC(number)
When you specify a number as an argument, the TRUNCATE function truncates a number to a specified number of decimal places.

TRUNC (number, tvalue)


tvalue is an integer value that specifies the number of places to the right or left of the decimal point to which the number should be truncated. When the tvalue parameter is positive, digits to the right of the decimal point are truncated. When tvalue is negative the digits to the left of the decimal point are truncated. When the tvalue parameter is omitted, number is truncated to 0 decimal places.

Related Links:

Related Code Snippets:
 
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us 64 users online    © 2009 psoug.org
PSOUG LOGIN
Username: 
Password: 
Forgot your password?