Sep 2, 2010 4:19 AM
What is the equivalent of datename in Netezza?
-
Like (0)
SELECT DATENAME(month, GETDATE()) AS 'Month Name'
This returns September in microsft SQL Server.
I need to get a equivalent of the Datename function in Netezza.
I think you can use the to_char function with a format pattern of 'Month' which should give you a mixed-case full month name. See Database Users guide..
D.
If you need this for the current date then you can use either of the following:
SYSTEM(ADMIN)=> select to_char(now(),'Month');
TO_CHAR
-----------
September
(1 row)
SYSTEM(ADMIN)=> select to_char(current_date,'Month');
TO_CHAR
-----------
September
(1 row)
If you need it for a date value stored in a column of a table, simply change now() or current_date to the column name and add a "from table tablename" to the SQL.

