Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Harry C
Posting Yak Master
148 Posts |
Posted - 2005-06-24 : 15:58:19
|
| The Select Statement above would return a record like soProjectID :: EventID :: EstimatedCompletionDate :: LeadTime1 :: 1 :: :: 101 :: 2 :: :: 201 :: 3 :: :: 5So, what I need to do here is to take @CustomerShipDate, which is passed into the stored proc, the count the days backward. So, if @CustomerShipDate were 07/25/2005, and I were calculating for EventID 3. I could say DateAdd(day, LeadTime(which is 5), @CustomerShipDate).But, now, how would I get the rest of the values?? Because now, for EventID 2, I need to sayDateAdd(day, LeadTime(EventID 3 LeadTime which is 5 MINUS EventID 2 LeadTime which is 20 ), @CustomerShipDate)Does this makes sense? Thanks for lookingINSERT INTO ProjectEvent(ProjectID, EventID, EstimatedCompletionDate, LeadTime) SELECT @ProjectID, CompanySeasonProductTemplate.EventID, (Calculate Estimated CompletionDate Here), Event.LeadTime FROM CompanySeasonProductTemplate INNER JOIN Event ON CompanySeasonProductTemplate.EventID = Event.EventID WHERE (CompanySeasonProductTemplate.CompanyID = @CompanyID) AND SeasonID Is Null AND ProductCategoryID Is Null ORDER BY EventOrder |
|
|
Harry C
Posting Yak Master
148 Posts |
Posted - 2005-06-24 : 15:59:30
|
| Sorry, I meant to post this in the TSQL forum...so sorry... |
 |
|
|
|
|
|
|
|