private static List<Appointment> findDailyByDaySpan(long uid,
			long startDay, long endDay) throws SQLException {
		List<Appointment> aAppt = new ArrayList<Appointment>();

		// select * from Appointment where frequency = $DAILY
		// and startTime <= $(endDay+DateUtil.DAY_LENGTH)
		// and lastDay >= $startDay
		PreparedStatement statement =
				connect.prepareStatement("select * from ("
						+ makeSqlSelectorForUser(uid)
						+ ") as Temp where frequency = ? "
						+ "and startTime <= ? " + "and lastDay >= ? ");
		statement.setInt(1, Frequency.DAILY);
		statement.setLong(2, endDay + DateUtil.DAY_LENGTH);
		statement.setLong(3, startDay);
		ResultSet resultSet = statement.executeQuery();
		while (resultSet.next())
		{
			aAppt.add(Appointment.createOneFromResultSet(resultSet));
		}
		return aAppt;
	}