public static String composeDateWhere(String sql, String fieldName,
			String fieldValue, int action) {
		if (fieldValue == null || fieldValue.trim().compareTo("") == 0)
			return sql;
		String sTmp = fieldValue;
		String sOper = "=";
		switch (action) {
		case EQUAL:
			sTmp = "'" + sTmp + "'";
			break;
		case LIKE:
			sTmp = "'%" + sTmp + "%'";
			sOper = " like ";
			break;
		case GE:
			sTmp = "'" + sTmp + "'";
			sOper = " >= ";
			break;
		case LE:
			sTmp = "'" + sTmp + "'";
			sOper = " <= ";
			break;
		case IN:
			sTmp = "('" + sTmp + "')";
			sOper = " in ";
			break;
		default:
			sTmp = "'" + sTmp + "'";
		}
		if (sql == null || sql.trim().compareTo("") == 0)
			return " WHERE " + fieldName + sOper + sTmp;
		else
			return sql + " AND " + fieldName + sOper + sTmp;
	}