4/30/12

Netezza Date Conversions :


SELECT TO_TIMESTAMP(CURRENT_TIMESTAMP,'YYYY-MM-DD HH24:MI:SS')

TO_TIMESTAMP
-------------
10/24/2011 4:42:35.000156

SELECT TO_DATE(CURRENT_TIMESTAMP,'YYYY-MM-DD HH24:MI:SS')

TO_DATE
----------
10/24/2011


DATE_PART :

EX ;
SELECT DATE_PART('MONTH',CURRENT_TIMESTAMP)

DATE_PART
---------------
         10

DATE_TRUNC : 

BEFORE TRUNC ;
SELECT CURRENT_TIMESTAMP
----------------------------------
10/24/2011 4:54:11.001598


AFTER TRUNC HOUR :

SELECT DATE_TRUNC('HOUR',CURRENT_TIMESTAMP)
-------------------------------------

10/24/2011 4:00:00.001598



0 comments:

Post a Comment