> Hello Friends,
>
> I have a table that as two fields "Productcode" & "Needlecode".
> This has many to many relationship.
> What I means is:
>
> A single productcode can have lot of needlecodes.
> A single needlecode can have lot of productcodes.
>
> What I need to generate is a report that should have by productcode with all respective needlecodes.
> I have been thinking to write a query regarding that.
> But i am not getting perfect thinking.I am totally clueless.
> Please help me.
> I will be so thankful to you.
>
> Thanks & Regards,
> Chandra0315.
You should also have a table "Products" where productcode is the unique primary key, + columns that describe each product. And a "Needles" table where the 'needlecode' is the unique primary key. So a complete data retrieval in a query would be:
SELECT * FROM Products P JOIN ProductsNeedles AS PN ON P.productcode=PN.productscode ;
JOIN Needles AS N ON N.needlecode=PN.needlecode ;
ORDER BY P.productcode, N.needlecode INTO CURSOR ReportData1
You can ORDER BY any columns you like.
-Anders