diff --git a/pandora_console/godmode/agentes/planned_downtime.export_csv.php b/pandora_console/godmode/agentes/planned_downtime.export_csv.php
index efb349caeb..0fb2bcd354 100644
--- a/pandora_console/godmode/agentes/planned_downtime.export_csv.php
+++ b/pandora_console/godmode/agentes/planned_downtime.export_csv.php
@@ -63,7 +63,10 @@ if (!empty($date_from)) {
 }
 
 if (!empty($date_to)) {
-	$periodically_monthly_w = "type_periodicity = 'monthly' AND (periodically_day_from <= '".date('d', strtotime($date_from))."' AND periodically_time_to >= '".date('d', strtotime($date_to))."')";
+	$periodically_monthly_w = "type_periodicity = 'monthly'
+			AND ((periodically_day_from <= '".date('d', strtotime($date_from))."' AND periodically_day_to >= '".date('d', strtotime($date_to))."')
+				OR (periodically_day_from > periodically_day_to
+					AND (periodically_day_from <= '".date('d', strtotime($date_from))."' OR periodically_day_to >= '".date('d', strtotime($date_to))."')))";
 	
 	$periodically_weekly_days = array();
 	$date_from_aux = strtotime($date_from);