View previous topic :: View next topic
|
Author |
Message |
Cketha Warnings : 1 New User
Joined: 19 May 2007 Posts: 22 Location: mumbai
|
|
|
|
Hi,
In DB2 table the date format is mm/dd/yyyy.
While unloading table into file using UNLOAD SHRLEVEL CHANGE can i get date format yyyy-mm-dd ? Can you suggest some option. |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1042 Location: Richmond, Virginia
|
|
|
|
The DB2 internal date format is irrelevant to users, and the default output format is yyyy-mm-dd.
When you do a SELECT, do you get mm/dd/yyyy? If so, you must have something set to do so, or your installation must have that as the default setting.
Anyone out there know more than me? |
|
Back to top |
|
|
stodolas
Active Member
Joined: 13 Jun 2007 Posts: 632 Location: Wisconsin
|
|
|
|
It is possible, although I hope it isn't this way, that the date field isn't really defined as a date, but a CHAR(10) and the programs are taking care of the logic of working with the date in that format. I've seen it before, not taking advantage of native formats because of legacy code they don't want to change... |
|
Back to top |
|
|
stodolas
Active Member
Joined: 13 Jun 2007 Posts: 632 Location: Wisconsin
|
|
Back to top |
|
|
ruodeer
New User
Joined: 06 Jul 2007 Posts: 58 Location: home
|
|
|
|
Yes ,you can .
You can reformat the Date column in the Select clause from 'mm/dd/yyyy' to 'yyyy-mm-dd ' using DB2 builtin func ! |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1042 Location: Richmond, Virginia
|
|
|
|
Of course functions can be applied to SELECTed fields, but op implies that the date is coming back mm/dd/yyyy and he wants yyyy-mm-dd.
I would hope that he wouldn't be using a function, then asking how to get it back the standard way. |
|
Back to top |
|
|
|