aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Script/Questionnaires.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/Script/Questionnaires.pm')
-rw-r--r--perllib/FixMyStreet/Script/Questionnaires.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/Script/Questionnaires.pm b/perllib/FixMyStreet/Script/Questionnaires.pm
index aab4b9b75..5db66ff7c 100644
--- a/perllib/FixMyStreet/Script/Questionnaires.pm
+++ b/perllib/FixMyStreet/Script/Questionnaires.pm
@@ -33,8 +33,8 @@ sub send_questionnaires_period {
};
$q_params->{'-or'} = [
- '(select max(whensent) from questionnaire where me.id=problem_id)' => undef,
- '(select max(whenanswered) from questionnaire where me.id=problem_id)' => { '<', \"current_timestamp - '$period'::interval" }
+ \'(select max(whensent) from questionnaire where me.id=problem_id) IS NULL',
+ \"(select max(whenanswered) from questionnaire where me.id=problem_id) < current_timestamp - '$period'::interval",
];
my $unsent = FixMyStreet::DB->resultset('Problem')->search( $q_params, {