If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Small SQL help

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-24-04, 10:18
mark_tim1999 mark_tim1999 is offline
Registered User
 
Join Date: Dec 2003
Posts: 14
Small SQL help

how do we convert YYYY-MM-DD format to Mon.,dd,yy format?
2004-14-04 to Apr.,14,04
Reply With Quote
  #2 (permalink)  
Old 05-24-04, 11:48
dsusendran dsusendran is offline
Registered User
 
Join Date: Apr 2004
Location: Inside Intel
Posts: 165
Talking DB2 date functions

Reply With Quote
  #3 (permalink)  
Old 05-24-04, 14:32
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
There is no built-in SQL function to do that. You might look at the supplied DB2 functions or write one yourself. You would probably need the CASE statement.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #4 (permalink)  
Old 05-25-04, 08:08
J Petruk J Petruk is offline
Registered User
 
Join Date: Mar 2004
Location: Toronto, ON, Canada
Posts: 513
Quote:
Originally Posted by mark_tim1999
how do we convert YYYY-MM-DD format to Mon.,dd,yy format?
2004-14-04 to Apr.,14,04
Use the DAY(), YEAR(), and MONTH()/MONTHNAME() to extract the pieces, and concat them together how you'd like them.
__________________
--
Jonathan Petruk
DB2 Database Consultant
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On