My input: YYYYMM(varchar(6))
My requirement is YYYYMMDD
eg:20151201 & 20151231 (First day of month and last day of month)
SELECT CAST(CAST(MY_COL AS DATE FORMAT 'YYYYMM') AS FORMAT 'YYYY-MM-DD') FDOM,
ADD_MONTHS(FDOM, 1 ) - 1 LDOM
FROM ( SELECT '201511' MY_COL ) a
*** Query completed. One row found. 2 columns returned.
*** Total elapsed time was 1 second.