public int getAnuncisVigents(String abrev) {
        int vigents = 0;
        String SQL1 = "SELECT STR_TO_DATE(SUBSTRING(mis.missatge, LOCATE(';eventdate={',mis.missatge)+12,10),'%d-%m-%Y') AS eventDate, "+
                     "STR_TO_DATE(SUBSTRING(mis.missatge, LOCATE(';eventdate2={',mis.missatge)+13, 10) , '%d-%m-%Y') AS eventDate2  FROM "+
                     "sig_missatges AS mis LEFT JOIN sig_professorat AS prof ON mis.de=prof.abrev "+
                     "WHERE mis.para LIKE '%*%' OR mis.para LIKE '%"+abrev+"%'";
        
        Calendar cal1 = Calendar.getInstance();
        Calendar cal2 = Calendar.getInstance();
        Calendar calnow = Calendar.getInstance();
        calnow.set(Calendar.HOUR_OF_DAY, 0);
        calnow.set(Calendar.MINUTE, 0);
        calnow.set(Calendar.SECOND, 0);
        calnow.set(Calendar.MILLISECOND, 0);
      
        try {
            Statement st = client.getMysql().createStatement();
            ResultSet rs = client.getMysql().getResultSet(SQL1);
            while(rs!=null && rs.next())
            {
                Date date1 = rs.getDate(1);
                Date date2 = rs.getDate(2);
                if(date1!=null)
                {
                    cal1.setTime(date1);
                    if(date2!=null)
                    {
                        cal2.setTime(date2);
                        if(cal1.compareTo(calnow)<=0 && calnow.compareTo(cal2)<=0)
                        {
                            vigents += 1;
                        }
                    }
                    else
                    {
                        if(cal1.compareTo(calnow)>=0)
                        {
                            vigents += 1;
                        }
                    }
                }
                
            }
            if(rs!=null)
            {
                rs.close();
                st.close();
            }
        } catch (SQLException ex) {
            Logger.getLogger(AnuncisClient.class.getName()).log(Level.SEVERE, null, ex);
        }
        
        return vigents;
    }