• Thanks, much appreciated answers.

    I've also just realised another problem that I'm going to come up against.

    The next stage in this script I'm writing is that it is going to clear out the data from Table2 that I have just inserted into Table1.

    However, it is a high turnover table and in the time it takes to insert the data and gets round to deleting data in the next statement, new data will have been inserted into Table2.

    So how would I write a GETDATE minus 1 month from 17:00 that day so I can use exactly the same WHERE clause for the next statement?

    Dh g gjhfvghhgfdfg