anchor.diff:  	if (dateBefore != null && !dateBefore.isEmpty()) {
   		%>contains data recorded before <%= dateBefore%>', <%
   		//dateBefore = "AND a.date_created <= TO_DATE("+dateBefore+",'mm/dd/yyyy')";
  -	   queryAudio = queryAudio + " AND a.date_created <= TO_DATE('"+dateBefore+"','dd/mm/yyyy')";
  -	   queryImage = queryImage + " AND i.date_created <= TO_DATE('"+dateBefore+"','dd/mm/yyyy')";
  -	   queryScalar = queryScalar + " AND s.date_created <= TO_DATE('"+dateBefore+"','dd/mm/yyyy')";
  +	   queryAudio = queryAudio + " AND a.date_created <= TO_DATE('"+dateBefore+"','dd/mm/yyyy HH24:MI:SS')";
  +	   queryImage = queryImage + " AND i.date_created <= TO_DATE('"+dateBefore+"','dd/mm/yyyy HH24:MI:SS')";
  +	   queryScalar = queryScalar + " AND s.date_created <= TO_DATE('"+dateBefore+"','dd/mm/yyyy HH24:MI:SS')";
   
   	   //querySensor = querySensor + " AND sen.date_created <= TO_DATE('"+dateBefore+"','dd/mm/yyyy')";
   
  
positive.code: 	   queryImage = queryImage + " AND sen.sensor_id = i.sensor_id AND sen.sensor_type = '"+ sensorType+"'";
  	   queryScalar = queryScalar + " AND sen.sensor_id = s.sensor_id AND sen.sensor_type = '"+ sensorType+"'";
  
  	   querySensor = querySensor + " AND sen.sensor_type = '"+sensorType+"'";
  
  	}
  	if (location != null && !location.isEmpty()) {
  
negative.code: 	    //keywords = "AND a.description LIKE '%"+keywords+"%'";
   	   //queryAudio = queryAudio + " AND a.description LIKE '%"+keywords+"%'";
   	   //queryImage = queryImage + " AND i.description LIKE '%"+keywords+"%'";
  	   queryAudio = queryAudio + " AND sen.sensor_id = a.sensor_id AND (a.description = '"+keywords+"' OR sen.description = '"+ keywords+"')";
   	   queryImage = queryImage + " AND sen.sensor_id = i.sensor_id AND (i.description = '"+keywords+"' OR sen.description = '"+ keywords+"')";
   	   queryScalar = queryScalar + " AND sen.sensor_id = s.sensor_id AND sen.description = '"+ keywords+"'";
  	   //querySensor = querySensor + " AND sen.description = '"+keywords+"'";
  
  
  
  