Thanks a lot admin. I noticed that it only the data on the second table is being copied on succeeding clicks and no dup checking if data for the day has already has already been exported. Could be with the loop but cant figure out where to fix it in our code.