     ;; There is no datetimeRange element for AdditionalAttribute in AQL,
     ;; the dateRange element covers both the date type and datetime type of AA.
     ;; This is different from parameter search of AA.
-    (gc/or-conds
-      [(qm/map->AttributeRangeCondition
-         {:type :datetime
-          :name attrib-name
-          :min-value start-date
-          :max-value stop-date})
-       (qm/map->AttributeRangeCondition
-         {:type :date
-          :name attrib-name
-          :min-value start-date
-          :max-value stop-date})])))
+    (if (or start-date stop-date)
+      (gc/or-conds
+        [(qm/map->AttributeRangeCondition
+           {:type :datetime
+            :name attrib-name
+            :min-value start-date
+            :max-value stop-date})
+         (qm/map->AttributeRangeCondition
+           {:type :date
+            :name attrib-name
+            :min-value start-date
+            :max-value stop-date})])
+      {:errors [(msg/one-of-min-max-msg)]})))
 
 (defmethod attrib-value-element->condition :time
   [attrib-name value-elem]

  (let [attrib-name (cx/string-at-path additional-attribute [:additionalAttributeName])
        attrib-value (first (cx/content-at-path additional-attribute [:additionalAttributeValue]))]
    (attrib-value-element->condition attrib-name attrib-value)))

;; Converts additionalAttributes element into query condition, returns the converted condition
(defmethod a/element->condition :attribute

(defmethod attrib-value-element->condition :timeRange
  [attrib-name value-elem]
  (let [[start-time stop-time] (parse-time-range-element value-elem)]
    (if (or start-time stop-time)
      (qm/map->AttributeRangeCondition
        {:type :time
         :name attrib-name
         :min-value start-time
         :max-value stop-time})
      {:errors [(msg/one-of-min-max-msg)]})))

(defn- additional-attribute-element->conditions
  "Returns the query conditions of the given additionalAttribute element"
