Partilhar via


Date and Time Functions (Report Builder)

Use these functions to calculate date and time values. For example, suppose you want to know which day of the week typically has the most number of sales. Using the DAYOFWEEK function, you could create a formula that identifies the number of sales orders per day. Here is another example, suppose you want to compare quarterly earnings over the past year. Using the QUARTER function, you could break down the sales for the entire year by quarter.

Date and Time functions can use the following data types: String, Integer, and DateTime. Their default format is determined by your local computer locale settings.

In This Section

Topic Description

DATE

Returns a datetime value given a year, month, and day.

DATEADD (Report Builder)

Returns a datetime that is the result of adding the specified number of time interval units to the original datetime.

DATEDIFF (Report Builder)

Returns the difference between the Start datetime and the End datetime.

DATETIME (Report Builder)

Returns a datetime given the year, month, day, hour, minute, and second.

DATEONLY (Report Builder)

Returns the year, month, and day from a datetime value.

DAY

Extracts the day from a datetime.

DAYOFWEEK (Report Builder)

Returns the day of the week.

DAYOFYEAR

Returns the day of the year of the datetime.

HOUR

Extracts the hour from a datetime.

MINUTE

Extracts the minute from a datetime.

MONTH

Returns the month from a datetime.

NOW

Returns the current date and time.

QUARTER

Returns the calendar quarter (1-4) from a datetime.

SECOND

Extracts the second from a datetime.

TODAY

Returns the current date.

WEEK

Returns the numeric value for the week within the calendar year.

YEAR

Returns a year value from a datetime.

See Also

Concepts

Using Functions (Report Builder)
Working with Formulas (Report Builder)
Report Builder How-to Topics

Help and Information

Getting SQL Server 2005 Assistance