$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);
$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 ";
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)) {