add attachment filter in sql request