Here it is..
SELECT databasename as DBNAME,
tablename as TBLNAME,
CAST(createtimestamp AS DATE FORMAT 'YYYY-MM-DD')(CHAR(10)) as CREATE_DATE
FROM DBC.TABLES
WHERE DBNAME = 'DB1' AND Tablekind='T' AND
createtimestamp >= ADD_MONTHS(DATE - EXTRACT(DAY FROM DATE) + 1, -1)
AND
createtimestamp <= (DATE - EXTRACT(DAY FROM DATE))
ORDER BY 1;
↧