Connecting Tech Pros Worldwide Forums | Help | Site Map

Which function has TOTAL equivalent to Oracle's TO_CHAR?

Newbie
 
Join Date: Aug 2009
Posts: 1
#1: Aug 12 '09
The Oracle function TO_CHAT accept DATE datatype. In DB2, i know that exist the VARCHAR_FORMAT function (synonym TO_CHAR), but this function only accepts TIMESTAMP datatypes.
How can i have the same result in DB2, like this SQL in Oracle:
SELECT to_char(data_entrada,'YYYYMM') FROM t1

Obs: data_entrada is of datatype DATE.

Thanks,
Wellerson

vijay2082's Avatar
Newbie
 
Join Date: Aug 2009
Location: UK
Posts: 22
#2: Aug 12 '09

re: Which function has TOTAL equivalent to Oracle's TO_CHAR?


upgarde to db2 udb V 9.7 or create the to_char equivalent in earlier udb database as in oracle database.

http://www.ibm.com/developerworks/da...dm-0712gosavi/

Regards

Vijay
Reply