Page 1 of 1

I want Date Format

Posted: Sun Mar 19, 2006 10:57 pm
by suneel kumar
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

Posted: Sun Mar 19, 2006 11:05 pm
by ray.wurlod
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.

Posted: Sun Mar 19, 2006 11:06 pm
by ameyvaidya
Hi Suneel,
If the input is string (varchar or Char), You can just append the '01' to the end of the input.
IHTH