Implement datetime_extract_sql operation.