Can we get date format as MMM'YY

General
Enthusiast

Can we get date format as MMM'YY

Is there any chance that I can get date format as MMM'YY ??

how can we concatenate " ' " between month and year ??

Regards,

Narasimha

4 REPLIES
Enthusiast

Re: Can we get date format as MMM'YY

You can use th following query.

SELECT  SUBSTRING(MDate FROM 4 FOR 3) || '''' ||SUBSTRING(MDate FROM 1 FOR 2)
FROM
(
SELECT (YOUR_DATE_COLUMN (FORMAT 'YY-MMM-DD')) (CHAR(11)) AS MDate
) DRV
Khurram
Enthusiast

Re: Can we get date format as MMM'YY

Try this

SELECT CAST(CAST(CURRENT_DATE AS DATE FORMAT 'MMM') AS CHAR(3)) 
|| '''' ||
CAST(CAST(CURRENT_DATE AS DATE FORMAT 'YY') AS CHAR(2))
Junior Contributor

Re: Can we get date format as MMM'YY

Simply add it to the format:

SELECT DATE (FORMAT 'mmm''yy') (CHAR(6))

Dieter

Enthusiast

Re: Can we get date format as MMM'YY

Dieter,

Thank you very much for such a valueable information.

Khurram