New SQL Functions

In this section:

The QUARTER and WEEKDAY SQL functions are supported.


Top of page

x
QUARTER: Returning the Quarter of the Year

How to:

Given a date or date-time value, QUARTER returns an integer (from 1 to 4) that represents the quarter within which that date falls.



x
Syntax: How to Return the Quarter of the Year
QUARTER(arg)

where:

arg

Date or date-time

Is the input date or date-time value.



Example: Returning the Quarter of the Year

QUARTER returns the quarter of the year for each date of birth:

QUARTER(DATE_OF_BIRTH)

For 1993/03/27, the result is 1.


Top of page

x
WEEKDAY: Returning the Day of the Week

How to:

Given a date or date-time value, WEEKDAY returns an integer from 1 (Monday) to 7 (Sunday) representing the day of the week for that date.



x
Syntax: How to Return the Day of the Week
WEEKDAY(arg)

where:

arg

Date or date-time

Is the input date or date-time value.



Example: Returning the Day of the Week

WEEKDAY returns the day of the week for each birth date, where 1 represents Monday and 7 represents Sunday:

WEEKDAY(DATE_OF_BIRTH)

For 1993/03/27, the result is 6 (Saturday).


WebFOCUS