Hi Gustaf Thank you for the help, but I have over 1000 records, I can’t write it all in the code I didn’t get the code I’m sorry. Regards Mohamad Al-shammari -- View this message in context: http://r.789695.n4.nabble.com/R-loop-tp1979620p2051726.html Sent from the R help mailing list archive at Nabble.com.