I am attempting to populate a table based on 2 and 3 week intervals for a semi-monthly pay period in TSQL. The table should populate,
2 week date
2 week date
3 week date
2 week date
2 week date
3 week date
..based on the first date I supply, subsequently adding 2 or 3 weeks to the last date supplied. I should be able to supply a start date and end date. It may be that it’s just early in the morning, but can’t think of an elegant way to accomplish this task. Any pointers?
Thanks!
George
Horrid brute force approach – because the 2,2,3 is difficult to loop just adding it regardless into the temp table and then filtering at the end incase a couple extra entries go in – not the most efficient but if you are needing to just get a range one off then it works.
So the caveat here is: ok for one off, I wouldn’t use in production 🙂