I've created an ssis package that does some importing and manipulation. I need to put the last day of the month in my date field. The process is run once a month and no matter when it's run I need to put in the last day of the month. The queries below will give me the last day of the month. How would I combine these to make my date field look like this 20090531?
select year(dateadd(ms,-3,DATEADD(mm, DATEDIFF(m,0,getdate() )+1,0)))
select month(dateadd(ms,-3,DATEADD(mm, DATEDIFF(m,0,getdate() )+1,0)))
select day(dateadd(ms,-3,DATEADD(mm, DATEDIFF(m,0,getdate() )+1,0)))
select year(dateadd(ms,-3,DATEADD(mm, DATEDIFF(m,0,getdate() )+1,0)))
select month(dateadd(ms,-3,DATEADD(mm, DATEDIFF(m,0,getdate() )+1,0)))
select day(dateadd(ms,-3,DATEADD(mm, DATEDIFF(m,0,getdate() )+1,0)))