petejigsaw
MIS
I need to link two tables which have complimentary data, but no common field that will enable simple linking. To get the report to show the right data, they need to link on a composite field.
The two tables are {colour} and {stkmast}. I can create a formula that creates a common value in each table, but I do not know how I am going to be able to link them together??????
The two formulas are:
For {colour}:
{colour.cf_company} +
(IF (not(isnull ({colour.cf_supplier}))) then {colour.cf_supplier} else "??????")+
(IF (not(isnull ({colour.cf_range}))) then {colour.cf_range} else "????")+
(IF (not(isnull ({colour.cf_fabric}))) then {colour.cf_fabric} else "????")
+ {colour.cf_colour_code}
For {stkmast}:
IF( {stkmast.st_col_level} = 5) then ({stkmast.st_company} + "??????????" +
Mid ({stkmast.st_prod_code},1 , 4)+ Mid ({stkmast.st_prod_code},9 , 4)+ {stkmast.st_colour_cd})
else
IF( {stkmast.st_col_level} = 2) then ({stkmast.st_company} + {stkmast.st_sup_code} + "????" +
Mid ({stkmast.st_prod_code},9,4 )+ {stkmast.st_colour_cd})
else
IF( {stkmast.st_col_level} = 7) then ({stkmast.st_company} + "??????????" + "????" +
Mid ({stkmast.st_prod_code},9 ,4 )+ {stkmast.st_colour_cd})
else
IF( {stkmast.st_col_level} = 3) then ({stkmast.st_company} + {stkmast.st_sup_code} +
Mid ({stkmast.st_prod_code},1 ,4 ) + "????" + {stkmast.st_colour_cd})
else
IF( {stkmast.st_col_level} = 6) then ({stkmast.st_company} + "??????????" +
Mid ({stkmast.st_prod_code},1 ,4 )+ "????" + {stkmast.st_colour_cd})
else
IF( {stkmast.st_col_level} = 4) then ({stkmast.st_company} + {stkmast.st_sup_code} + "????" + "????" + {stkmast.st_colour_cd})
else
IF({stkmast.st_col_level}=1) then ({stkmast.st_company} + {stkmast.st_sup_code} + Mid ({stkmast.st_prod_code},1 ,4 ) + Mid ({stkmast.st_prod_code},9 ,4 ) + {stkmast.st_colour_cd})
else
"???????"
Can anyone help.......?
I have tried using Business Views etc to do this without success, and its now driving me crackers!!!!!!
Thanks for any assistance.
The two tables are {colour} and {stkmast}. I can create a formula that creates a common value in each table, but I do not know how I am going to be able to link them together??????
The two formulas are:
For {colour}:
{colour.cf_company} +
(IF (not(isnull ({colour.cf_supplier}))) then {colour.cf_supplier} else "??????")+
(IF (not(isnull ({colour.cf_range}))) then {colour.cf_range} else "????")+
(IF (not(isnull ({colour.cf_fabric}))) then {colour.cf_fabric} else "????")
+ {colour.cf_colour_code}
For {stkmast}:
IF( {stkmast.st_col_level} = 5) then ({stkmast.st_company} + "??????????" +
Mid ({stkmast.st_prod_code},1 , 4)+ Mid ({stkmast.st_prod_code},9 , 4)+ {stkmast.st_colour_cd})
else
IF( {stkmast.st_col_level} = 2) then ({stkmast.st_company} + {stkmast.st_sup_code} + "????" +
Mid ({stkmast.st_prod_code},9,4 )+ {stkmast.st_colour_cd})
else
IF( {stkmast.st_col_level} = 7) then ({stkmast.st_company} + "??????????" + "????" +
Mid ({stkmast.st_prod_code},9 ,4 )+ {stkmast.st_colour_cd})
else
IF( {stkmast.st_col_level} = 3) then ({stkmast.st_company} + {stkmast.st_sup_code} +
Mid ({stkmast.st_prod_code},1 ,4 ) + "????" + {stkmast.st_colour_cd})
else
IF( {stkmast.st_col_level} = 6) then ({stkmast.st_company} + "??????????" +
Mid ({stkmast.st_prod_code},1 ,4 )+ "????" + {stkmast.st_colour_cd})
else
IF( {stkmast.st_col_level} = 4) then ({stkmast.st_company} + {stkmast.st_sup_code} + "????" + "????" + {stkmast.st_colour_cd})
else
IF({stkmast.st_col_level}=1) then ({stkmast.st_company} + {stkmast.st_sup_code} + Mid ({stkmast.st_prod_code},1 ,4 ) + Mid ({stkmast.st_prod_code},9 ,4 ) + {stkmast.st_colour_cd})
else
"???????"
Can anyone help.......?
I have tried using Business Views etc to do this without success, and its now driving me crackers!!!!!!
Thanks for any assistance.