HI All,
I want to convert the timestamp inp date to date type in output with the following format,
Inp:
2010-02-10 02:30:40
Ouput i Need with date as datatype:
20100210
Using functions Timestamptodate and datetostring, i got 20100210 in the output but as string, when i give the datatype Date it includes hypen '-' in the date.
Can you please suggest your view on this.
Thanks,
Senthil P
Tmestamp to date conversion
Moderators: chulett, rschirm, roy
Binary data types such as numbers, dates and timestamps have no internal format. Formatting is applied only when converting from another data type on input or output.
So the important question is what is your output (sequential file or database) and what is the datatype defined as in the target. Note that a text file doesn't have a Date or Time datatype but uses strings only and thus an implicit conversion from your internal datatype to the display one is done and you can specify your "YYYYMMDD" on output.
So the important question is what is your output (sequential file or database) and what is the datatype defined as in the target. Note that a text file doesn't have a Date or Time datatype but uses strings only and thus an implicit conversion from your internal datatype to the display one is done and you can specify your "YYYYMMDD" on output.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
No, this is not possible. A database DATE column has no format.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The apparent format of dates, times and timestamps is determined by default via settings in the Administrator client. These can be overridden in jobs and even in functions such as StringToDate().
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.