By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,924 Members | 1,727 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,924 IT Pros & Developers. It's quick & easy.

DB2 equivalent of Oracle to_char(created_date,'MM/DD/YYYY')

P: n/a
What is the DB2 equivalent syntax of Oracle's :

select to_char(created_date,'MM/DD/YYYY') from foo
Thanks

Nov 12 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
<gi*******************@yahoo.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
What is the DB2 equivalent syntax of Oracle's :

select to_char(created_date,'MM/DD/YYYY') from foo
Thanks

What does to_char do? If it converts a date to 'MM/DD/YYYY' format, then you
can use:

CHAR(created_date, USA)

Check the SQL Reference vol 1 for other CHAR date formats.
Nov 12 '05 #2

P: n/a
Wow, thanks for the quick response Mark ...

I forgot to mention that created_date is a DB2 TIMESTAMP.

When I execute this statment :

select char(created_date,USA) from foo

I get the following message :

SQL017N The type, length or value of argument "1" of routine
"SYSIBM.CHAR" is incorrect SQLSTATE=42815
Is the SQL Reference you are refering to DB2 specific?

Thanks.

Nov 12 '05 #3

P: n/a
CHAR(DATE(created_date), USA)

Nov 12 '05 #4

P: n/a
You're the man. Thanks Tonkuma!

Nov 12 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.