For publications:
Select SI_ID, SI_NAME, SI_KIND, SI_PARENT_FOLDER ,
SI_SCHEDULEINFO.SI_DESTINATIONS, SI_INSTANCE, SI_SCHEDULE_STATUS
from CI_INFOOBJECTS where SI_KIND = 'Publication'
and SI_INSTANCE = 0
and SI_SCHEDULEINFO.SI_DESTINATIONS.SI_TOTAL > 0
and "si_scheduleinfo.si_destinations.1.si_progid" = 'CrystalEnterprise.Smtp'
and
( "si_scheduleinfo.si_destinations.1.SI_DEST_SCHEDULEOPTIONS.SI_SENDER_NAME" like '%email%'
or ( "si_scheduleinfo.si_destinations.1.SI_DEST_SCHEDULEOPTIONS.SI_MAIL_ADDRESSES.SI_TOTAL" > 0
and "si_scheduleinfo.si_destinations.1.SI_DEST_SCHEDULEOPTIONS.SI_MAIL_ADDRESSES" like '%emailh%')
or ( "si_scheduleinfo.si_destinations.1.SI_DEST_SCHEDULEOPTIONS.SI_MAIL_BCC.SI_TOTAL" > 0
and "si_scheduleinfo.si_destinations.1.SI_DEST_SCHEDULEOPTIONS.SI_MAIL_BCC" like '%email%')
or ( "si_scheduleinfo.si_destinations.1.SI_DEST_SCHEDULEOPTIONS.SI_MAIL_CC.SI_TOTAL" > 0
and "si_scheduleinfo.si_destinations.1.SI_DEST_SCHEDULEOPTIONS.SI_MAIL_CC" like '%email%')
)
For schedule of publications:
Select SI_ID, SI_NAME, SI_KIND, SI_PARENT_FOLDER ,
SI_SCHEDULEINFO.SI_DESTINATIONS, SI_INSTANCE, SI_SCHEDULE_STATUS
from CI_INFOOBJECTS where SI_KIND = 'Publication'
and SI_INSTANCE = 1
and SI_SCHEDULE_STATUS = 9
and SI_SCHEDULEINFO.SI_DESTINATIONS.SI_TOTAL > 0
and "si_scheduleinfo.si_destinations.1.si_progid" = 'CrystalEnterprise.Smtp'
and
( "si_scheduleinfo.si_destinations.1.SI_DEST_SCHEDULEOPTIONS.SI_SENDER_NAME" like '%email%'
or ( "si_scheduleinfo.si_destinations.1.SI_DEST_SCHEDULEOPTIONS.SI_MAIL_ADDRESSES.SI_TOTAL" > 0
and "si_scheduleinfo.si_destinations.1.SI_DEST_SCHEDULEOPTIONS.SI_MAIL_ADDRESSES" like '%email%')
or ( "si_scheduleinfo.si_destinations.1.SI_DEST_SCHEDULEOPTIONS.SI_MAIL_BCC.SI_TOTAL" > 0
and "si_scheduleinfo.si_destinations.1.SI_DEST_SCHEDULEOPTIONS.SI_MAIL_BCC" like '%email%')
or ( "si_scheduleinfo.si_destinations.1.SI_DEST_SCHEDULEOPTIONS.SI_MAIL_CC.SI_TOTAL" > 0
and "si_scheduleinfo.si_destinations.1.SI_DEST_SCHEDULEOPTIONS.SI_MAIL_CC" like '%email%')
)