Search code examples
mysqlcrystal-reports

Show slave status where value = x


Is there a way to only show slave status when a 'value' is true? I am trying to create a Crystal Report that i then want to schedule with Crystal Server to email when the report contains data. I.e. When the slave is more then x number of seconds behind the master. In English, i want to:

show slave status
where seconds_behind_master > 100 or seconds_behind_master is null

I have found this other StackOverflow post but i dont think/know how to begin with adding a shell command as a Crystal Report command, if it can even be done.

Is there any way to filter the returned data based on a WHERE or something similar?

Thanks.


Solution

  • Managed to get around this, quite simply in fact.

    I just created the command in Crystal with "Show slave status" so it included anything. Then filtered and hid the details based on the criteria i mentioned in the OP on the "seconds_behind_master" field

    Suppress field based on the below formula in Crystal:

    not( isnull({Command.Seconds_Behind_Master}) or {Command.Seconds_Behind_Master} >100 )

    Simple when you think about it...maybe too simple and that's why i didn't. Hope it helps someone else one day.