Format Model for ROUND and TRUNC Date Functions

The table lists the format models you can use with the ROUND and TRUNC date functions and the units to which they round and truncate dates. The default model DD returns the date rounded or truncated to the day with a time of midnight.

Format model Rounding or truncating unit

CC

SCC

Century

If the last two digits of a four-digit year are between 01 and 99 (inclusive), then the century is one greater than the first two digits of that year.

If the last two digits of a four-digit year are 00, then the century is the same as the first two digits of that year. For example, 2002 returns 21; 2000 returns 20.

SYYYY

YYYY

YEAR

SYEAR

YYY

YY

Y

Year (rounds up on July 1)

IYYY

IYY

IY

I

ISO year

Q

Quarter (rounds up on the sixteenth day of the second month of the quarter)

MONTH

MON

MM

RM

Name of month (rounds up on the sixteenth day)

WW

Same day of the week as the first day of the year

IW

Same day of the week as the first day of the ISO week, which is Monday

W

Same day of the week as the first day of the month

DDD

DD

J

Day of year

DAY

DY

D

Starting day of the week

HH

HH12

HH24

Hour

MI

Minute