Re: Date conversion from mmddyy to ccyymmdd within SQL? -
08-11-2006
, 10:18 AM
Hi,
I assume, you want to convert a numeric date with the format MMDDYY into an other numeric date with the format of YYYYMMDD.
SQL provides no function to convert this directly, but you may use the following statement to convert from numeric MMDDYY to numeric YYYYMMDD.
<pre>
Select Cast(case when Substr(digits(MyMMDDYY), 5, 2)
between '40' and '99'
then '19' Else '20' End
concat Substr(digits(MyMMDDYY), 5, 2)
concat Substr(digits(MyMMDDYY), 1, 4) as Dec(8, 0))
From MyTable
</pre>
Birgitta |