select ... from table where table.day_in_month = to_number(to_char(sysdate,'dd')) #### select to_number( substr( min(to_char(CREATED, 'yyyymmddhh24miss') || FOO)), 15, 400 ) ) from table where ... #### select FOO from table where CREATED = (select min(FOO) from table where ...) and ... #### ------------ :Wq Not an editor command: Wq