Need explicit cast
authorJoey Schulze <joey@infodrom.org>
Mon, 9 Jun 2008 16:25:16 +0000 (16:25 +0000)
committerJoey Schulze <joey@infodrom.org>
Mon, 9 Jun 2008 16:25:16 +0000 (16:25 +0000)
src/InfoCon/stempel/index.wml
src/InfoCon/stempel/status.wml
src/InfoCon/stempel/submenu.inc

index 79c098b..c4af1ed 100644 (file)
@@ -33,7 +33,7 @@
 
   $query = "SELECT oid,start,customer,time,task FROM stempel WHERE time IS NOT NULL ";
   if (isset($month) && $month !== 'all')
-    $query .= "AND start LIKE '".$month."-%' ";
+    $query .= "AND cast(start AS TEXT) LIKE '".$month."-%' ";
   $query .= "ORDER BY customer,start";
 
   $sth = pg_exec ($dbh, $query);
index 1fcec70..85d10b6 100644 (file)
@@ -50,7 +50,7 @@ echo '<br'.$query;
 
     $query = "SELECT oid,start,customer,time,task FROM stempel WHERE time IS NOT NULL ";
     if (isset($month) && $month !== 'all')
-      $query .= "AND start LIKE '".$month."-%' ";
+      $query .= "AND cast(start AS TEXT) LIKE '".$month."-%' ";
     if (isset($status)) {
       if ($status != 'all')
         $query .= "AND status = $status ";
index 0f3a470..f3711da 100644 (file)
@@ -6,7 +6,7 @@
     global $dbh;
 
     $a = array();
-    $query = "SELECT DISTINCT substr(start,0,8) FROM stempel ORDER BY substr(start,0,8)";
+    $query = "SELECT DISTINCT substr(cast(start AS TEXT),0,8) FROM stempel ORDER BY substr(cast(start AS TEXT),0,8)";
     $sth = pg_exec ($dbh, $query);
 
     while ($row = pg_fetch_array ($sth)) {