All pastes #465545 Raw Edit

Anonymous

public text v1 · immutable
#465545 ·published 2007-04-30 12:30 UTC
rendered paste body
		$this->db->select('p.clientID as pClientID, m.clientID as mClientID');
		$this->db->distinct();
		$this->db->from('Hours AS h');
		$this->db->join('Jobs j', 'j.jobID = h.jobID', 'left');
		$this->db->join('Projects p', 'j.projectID = p.projectID', 'left');
		$this->db->join('Maintenance m', 'j.maintenanceID = m.maintenanceID', 'left');
		$this->db->where('h.invoiceID', 0);
		$this->db->where('( p.clientID IS NOT NULL or m.clientID IS NOT NULL)');
		$this->db->where('h.hourID IS NOT NULL');