Hi Guys,
Got an issue I cant seem to figure out...
I have one table that contains what part numbers are currently assigned in each country (table CurrentPart - columns Part_Number nvarchar(50), Country_Code nvarchar(2))
then another table that contains data about part replacements, structure as follows...
In the part replacement table - you could have Part A replaced by Part B
(Old_Part_Number = 'A' New_Part_Number = 'B')
...but then also part B could've been replaced by Part C
(so Old_Part_Number = 'B' New_Part_Number = 'C')
this could continue on for a fair few repetitions.
What I need to do is be able to report on the full hierarchy of the replacements, with the starting point being whatever the part list is from the CurrentPart table (column Part_Number)
... so for example..
CurrentPart..Part_Number = 'A'
CurrentPart..Country_Code = 'UK'
then in the PartReplacement table the succession of part replacements in countrycode 'UK' goes from 'A' through to part 'E' being the last part...
so i would need to show somthing like
Is this possible?!
Cheers in advance - any help greatly appreciated.
Got an issue I cant seem to figure out...
I have one table that contains what part numbers are currently assigned in each country (table CurrentPart - columns Part_Number nvarchar(50), Country_Code nvarchar(2))
then another table that contains data about part replacements, structure as follows...
Code:
CREATE TABLE PartReplacement](
[Old_Part_Number] [nvarchar](50) NULL,
[New_Part_Number] [nvarchar](50) NULL,
[Country_Code] [nvarchar](2) NULL,
[Indicator] [int]
)
In the part replacement table - you could have Part A replaced by Part B
(Old_Part_Number = 'A' New_Part_Number = 'B')
...but then also part B could've been replaced by Part C
(so Old_Part_Number = 'B' New_Part_Number = 'C')
this could continue on for a fair few repetitions.
What I need to do is be able to report on the full hierarchy of the replacements, with the starting point being whatever the part list is from the CurrentPart table (column Part_Number)
... so for example..
CurrentPart..Part_Number = 'A'
CurrentPart..Country_Code = 'UK'
then in the PartReplacement table the succession of part replacements in countrycode 'UK' goes from 'A' through to part 'E' being the last part...
so i would need to show somthing like
Code:
Country OldPart PartReplacements NewPart
UK A A,B,C,D,E E
Is this possible?!
Cheers in advance - any help greatly appreciated.