singlal wrote:
The function DAYNAME is not working (or I am not using it rightly). Is
there any other function that can be used to get the english day name
as string? If DAYNAME can be used, what should be its parameter?
Which version of DB2 you are using?
I don't believe you tried this function at all; just a simple test would give
you correct answer:
D:\Working>db2 values dayname(current date)
1
---------------------------------------------------------------------------
Wednesday
D:\Working>db2 values dayname(current timestamp)
1
---------------------------------------------------------------------------
Wednesday
1 record(s) selected.
Or a quick search for product documentation (available online at:
http://publib.boulder.ibm.com/infoce.../v8//index.jsp)
would reveal that:
DAYNAME scalar function
-DAYNAME--(--expression--)-----------------------------------><
The schema is SYSFUN.
Returns a mixed case character string containing the name of the day (for
example, Friday) for the day portion of the argument based on the locale when
the database was started.
The argument must be a date, timestamp, or a valid character string
representation of a date or timestamp that is neither a CLOB nor a LONG VARCHAR.
In a Unicode database, if a supplied argument is a graphic string, it is first
converted to a character string before the function is executed.
The result of the function is VARCHAR(100). The result can be null; if the
argument is null, the result is the null value.
Jan M. Nelken