From 6dc934e964d46960d284f68ab86669a0bbc9bd94 Mon Sep 17 00:00:00 2001
From: Sebastien Robin <seb@nexedi.com>
Date: Tue, 22 Mar 2005 15:33:26 +0000
Subject: [PATCH] make sure the min max feature of buildSqlQuery works fine
 with dates

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2733 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ZSQLCatalog/SQLCatalog.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/product/ZSQLCatalog/SQLCatalog.py b/product/ZSQLCatalog/SQLCatalog.py
index dd15317628..c73f67080c 100755
--- a/product/ZSQLCatalog/SQLCatalog.py
+++ b/product/ZSQLCatalog/SQLCatalog.py
@@ -1398,13 +1398,13 @@ class Catalog(Folder, Persistent, Acquisition.Implicit, ExtensionClass.Base):
                 query_min = min(query_value)
                 query_max = max(query_value)
                 if range_value == 'min' :
-                  query_item += ['%s >= %s' % (key, str(query_min)) ]
+                  query_item += ["%s >= '%s'" % (key, str(query_min)) ]
                 elif range_value == 'max' :
-                  query_item += ['%s < %s' % (key, str(query_max)) ]
+                  query_item += ["%s < '%s'" % (key, str(query_max)) ]
                 elif range_value == 'minmax' :
-                  query_item += ['%s >= %s and %s < %s' % (key, str(query_min), key, str(query_max)) ]
+                  query_item += ["%s >= '%s' and %s < '%s'" % (key, str(query_min), key, str(query_max)) ]
                 elif range_value == 'ngt' :
-                  query_item += ['%s <= %s' % (key, str(query_max)) ]
+                  query_item += ["%s <= '%s'" % (key, str(query_max)) ]
               else :
                 for query_value_item in query_value :
                   query_item += ['%s = %s' % (key, str(query_value_item))]
-- 
2.30.9