diff --git a/geomagio/api/db/MetadataDatabaseFactory.py b/geomagio/api/db/MetadataDatabaseFactory.py
index c7676bc7352d0e3db0cb9a96f0b95cbf38ed9ae1..83cdde6cffbbbe399b2ba583e17f6b6d83b43929 100644
--- a/geomagio/api/db/MetadataDatabaseFactory.py
+++ b/geomagio/api/db/MetadataDatabaseFactory.py
@@ -34,18 +34,18 @@ class MetadataDatabaseFactory(object):
         (
             id,
             category,
-            network,
-            station,
-            channel,
-            location,
             starttime,
             endtime,
             created_after,
             created_before,
+            network,
+            station,
+            channel,
+            location,
             data_valid,
             metadata_valid,
             status,
-        ) = params.dict().values()
+        ) = params.datetime_dict().values()
         if id:
             query = query.where(table.c.id == id)
         if category: