Another examples are ....
1)
SUBSTR(DIGITS(MONTH(CURRENT TIMESTAMP)),9,2)
||'/'||SUBSTR(DIGITS(YEAR(CURRENT TIMESTAMP)),7,4)
2)
CAST(INSERT(CHAR(DATE(CURRENT TIMESTAMP),USA),3,3,'') AS CHAR(7) )
3)
SUBSTR(REPLACE(CHAR(DATE(CURRENT TIMESTAMP),EUR),'.','/'),4,7)
4)
TRANSLATE('FG/ABCD', CHAR(CURRENT TIMESTAMP), 'ABCD-FG')
whitsey - 31 May 2007 11:35 GMT
> Another examples are ....
> 1)
[quoted text clipped - 9 lines]
> 4)
> TRANSLATE('FG/ABCD', CHAR(CURRENT TIMESTAMP), 'ABCD-FG')
THanks For that - works like a charm however, the sort order that the
dates are returned in the order of the months of the year i.e. Jan07,
Feb-07 ... Nov-06, Dec-06.
How do I sort it chronologically? i.e. Jun-06, Jul-06 ... Apr-07,
May-07
Serge Rielau - 31 May 2007 12:17 GMT
See my note to teh other thread. Use INTEGER(date)

Signature
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Tonkuma - 31 May 2007 13:35 GMT
I thought that you want to get the result with format 'mm/yyyy'.
But, if you don't stic that format and want to group by and sort order
of year/month,
followings would be the answer.
1)
INTEGER(DATE(CURRENT TIMESTAMP))/100
Result: yyyymm (INTEGER)
2)
SUBSTR(CHAR(CURRENT TIMESTAMP),1,7)
Result: 'yyyy-mm' (CHAR(7))