Function WEEKDAY() available in ABL but not in (Progress) SQ

Posted by PeterWokke on 10-Mar-2016 03:12

Using QlikView on ODBC to a Progress database I can use functions like YEAR(), MONTH() and WEEK() to get the year, month and week number from a date field.

To get the day of the week in ABL I use the function WEEKDAY().

This function is not working in a SQL select statement.

What function could I use in SQL to get the day of the week number from a date?

Kind regards,

Peter Wokke

All Replies

Posted by Dileep Dasa on 10-Mar-2016 04:58

DAYOFWEEK ( date_expression )

Returns the day of the week in the argument as a short integer value in the range of 1-7.
The argument date_expression can be the name of a column, the result of another scalar function, or a date or timestamp literal.

Example:

SELECT DAYOFWEEK('3/10/2016') FROM PUB.CUSTOMER;
dayofweek(3/10/2016)
--------------------
                   5

DAYNAME ( date_expression )

Returns a character string containing the name of the day (for example, Sunday through Saturday)

for the day portion of date_expression. The argument date_expression can be the name

of a column, the result of another scalar function, or a date or timestamp literal.

Example:

SELECT DAYNAME('3/10/2016') FROM PUB.CUSTOMER;
dayname(3/10/2016)
------------------
THURSDAY

Posted by PeterWokke on 10-Mar-2016 06:30

Hi Dileep,

Thank you kindly for the examples of both functions.

It helped me well building my QlikView data analyze.

Kind regards,

Peter

This thread is closed