|
I am trying to find the min date where the previous price was 0 - not all items have a previous prc being 0 - I could use some guidance to figure this out.... so in the example the date i want for 3456 is 1-15-2011
(comments are locked)
|
|
If you add this to your script does it give the results you need ? FatherJack - My apologies for not getting back to you but Yes - it does somewhat - what about other items that did not have 0 prc in the amount (5678) for example
Jul 26 '11 at 11:57 AM
siera_gld
@siera_gld If you simply need the product to show up in the results but show NULL for PRC, EFF_DT and END_DT (as these should because they don't satisfy the [b2].[PRC] = 0 condition then you can simply replace the inner join with left join and move the PRC = 0 to the join condition, i.e. from [#Base01] as b left [#Base01] as b2
on [b].[PRODUCT] = [b2].[PRODUCT]
and [b].[rn] = [b2].[rn] + 1
and [b2].[PRC] = 0;
Jul 26 '11 at 02:06 PM
Oleg
(comments are locked)
|

