Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/techsneeze/dmarcts-report-viewer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEduardo M KALINOWSKI <eduardo@kalinowski.com.br>2022-06-06 23:59:18 +0300
committerEduardo M KALINOWSKI <eduardo@kalinowski.com.br>2022-06-07 00:12:05 +0300
commit11c26cd58f2619f02210cb34faceb39012717d5c (patch)
tree4f9a5431f5996c7285c8518cb2e22d2c3522085c /dmarcts-report-viewer-report-list.php
parent90feb3a7b65b840285f0fb7ec46ff47e6480d8ec (diff)
Adjust queries so they work on PostgreSQL
Diffstat (limited to 'dmarcts-report-viewer-report-list.php')
-rw-r--r--dmarcts-report-viewer-report-list.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/dmarcts-report-viewer-report-list.php b/dmarcts-report-viewer-report-list.php
index 05e5fdf..806ed8c 100644
--- a/dmarcts-report-viewer-report-list.php
+++ b/dmarcts-report-viewer-report-list.php
@@ -239,7 +239,9 @@ if( $org_select <> '' ) {
if( $per_select <> '' ) {
$ye = substr( $per_select, 0, 4) + 0;
$mo = substr( $per_select, 5, 2) + 0;
- $where .= ( $where <> '' ? " AND" : " WHERE" ) . " ((year(mindate) = $ye AND month(mindate) = $mo) OR (year(maxdate) = $ye AND month(maxdate) = $mo)) ";
+ $where .= ( $where <> '' ? " AND" : " WHERE" )
+ . " ((extract(year from mindate) = $ye AND extract(month from mindate) = $mo) "
+ . " OR (extract(year from maxdate) = $ye AND extract(month from maxdate) = $mo)) ";
}
// Include the rcount via left join, so we do not have to make an sql query