![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have to write some sql that has to create a table from which a report runs that spans over the end of this year. It's code to build a table that a sales program report is generated from. The program itself runs until the end of January. From now thru January 2, orders in the program count. On January 3, I get a new table - the one I had been using gets changed to a previous year table, and the new one is the current year table. Also on that day, instead of orders counting (in the previous year) it goes to shipments. Orders count in the new (current year) table. The best way I can come up with to do this is to put in some code in the table build that builds it one day if getdate() is >= 01/03/2007, and another way if it's not. Is there a better way to do something like this, perhaps thru DTS? What I had in mind is to do something like this: if getdate() <= '01/02/2007' begin several passes at building the table end -- if getdate <= 01/02/2007 if getdate() >= '01/03/2007' begin several passes at building the table end -- if getdate >= 01/03/2007 |
![]() |
| Thread Tools | |
| Display Modes | |
| |