Hi All,
i want dateformat.
Example:
Input(200603) here year month
output(20060301) Here year month day
here every time day start on 01 by default in output.
Thanks in advance,
suneel
I want Date Format
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
It's not clear WHERE you want the date, nor whether you want to generate dates.
Certainly converting from 200603 to 20060301 is very simple; you make use of the fact that there are no data types in server jobs, and concatenate the "01".
But I suspect there is more to your question than that. Do you, for example, need to generate a sequence of dates? If so, is it only for the month in question, or for a potentially longer period?
There are solutions to all these variants, but we would like to be fully cognizant of your actual requirement.
Certainly converting from 200603 to 20060301 is very simple; you make use of the fact that there are no data types in server jobs, and concatenate the "01".
But I suspect there is more to your question than that. Do you, for example, need to generate a sequence of dates? If so, is it only for the month in question, or for a potentially longer period?
There are solutions to all these variants, but we would like to be fully cognizant of your actual requirement.
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.
-
- Charter Member
- Posts: 166
- Joined: Wed Mar 16, 2005 6:52 am
- Location: Mumbai, India
Hi Suneel,
If the input is string (varchar or Char), You can just append the '01' to the end of the input.
IHTH
If the input is string (varchar or Char), You can just append the '01' to the end of the input.
IHTH
Amey Vaidya<i>
I am rarely happier than when spending an entire day programming my computer to perform automatically a task that it would otherwise take me a good ten seconds to do by hand.</i>
<i>- Douglas Adams</i>
I am rarely happier than when spending an entire day programming my computer to perform automatically a task that it would otherwise take me a good ten seconds to do by hand.</i>
<i>- Douglas Adams</i>