View previous topic :: View next topic
|
Author |
Message |
arvind.m
Active User
Joined: 28 Aug 2008 Posts: 205 Location: Hyderabad
|
|
|
|
Hi
i need to select the timestamp as YYYYMMDDhhmmss format. can any one tell me how to format the timestamp using db2 query. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Arvind,
Thru SUBSTR and various DATE-TIME columnar functions you could have db2 return your formated timestamp.
I imagine that it would be faster to to SELECT/SET your 26 char host variable with a 'normal timestamp' and then create your format thru MOVE statements. |
|
Back to top |
|
|
arvind.m
Active User
Joined: 28 Aug 2008 Posts: 205 Location: Hyderabad
|
|
|
|
Thank you Dick. i got it using SUBSTR,CHAR and then concatinating all the fields to get as required format. |
|
Back to top |
|
|
|