Hi All,
I am about to write a Stored Procedure and thought i would ask if anyone had any advice.
The query is to take values from a default table, and add them to another "live" table.
Every monday an "A" shift is to take place. - From the default table
I want to take the that shift and make an entry in the live table for every Monday between two dates entered into the query and add it with the ID for Shift A.
If they were say 1/1/2000 and 31/1/2000 every Monday within these dates would have a Shift "A" added to it.
I want to do this for every value in the default table.
So, if I made any sense, have you any suggestions?
I am assuming I will need some sort of loop in the query and 7 if then statements to distinguish between the days of the week. But I do not know where to start...
I am about to write a Stored Procedure and thought i would ask if anyone had any advice.
The query is to take values from a default table, and add them to another "live" table.
Every monday an "A" shift is to take place. - From the default table
I want to take the that shift and make an entry in the live table for every Monday between two dates entered into the query and add it with the ID for Shift A.
If they were say 1/1/2000 and 31/1/2000 every Monday within these dates would have a Shift "A" added to it.
I want to do this for every value in the default table.
So, if I made any sense, have you any suggestions?
I am assuming I will need some sort of loop in the query and 7 if then statements to distinguish between the days of the week. But I do not know where to start...