SELECT id_commande,c.id_affaire,c.date AS date_debut, contact.email , DATE_ADD( c.date, INTERVAL month( c.date ) + SUM( IF( duree_1 IS NULL , 0, duree_1 ) + IF( duree_2 IS NULL , 0, duree_2 ) + IF( duree_3 IS NULL , 0, duree_3 ) + IF( duree_4 IS NULL , 0, duree_4 ) + IF( duree_5 IS NULL , 0, duree_5 ) ) MONTH ) AS date_fin FROM commande c, affaire WHERE c.id_affaire = affaire.id_affaire AND c.etat != 'annulee' left join societe on affaire.id_societe=societe.id_societe left join contact on contact.id_contact=societe.id_contact_facturation GROUP BY id_commande, c.date HAVING '2008-03-05' BETWEEN c.date AND date_fin