How to filter Data from to tables

Hi Experts,
I have problem in creating report because my some fields data in “trans. sales entry” and “Transaction Header”
table and i want data according to division code wise which is in “Item” but item no. is only exist in trans.
sales entry table how can i get the data according to division.Please give me suggestion.

[^o)]

I tried this logic but its not working .

“Trans. Sales Entry”.SETFILTER(Date, ‘%1…%2’,StartDate,EndDate);
IF “Trans. Sales Entry”.FIND(’-’) THEN REPEAT
IF (“Trans. Sales Entry”.“Store No.” = Old_Store_No) THEN BEGIN
IF (“Trans. Sales Entry”.“Item No.” =Item.“No.”) AND (Item.“Division Code” = ‘26’) THEN BEGIN
AccSold[x] := AccSold[x] + “Trans. Sales Entry”.Quantity;
END;
END;

UNTIL “Trans. Sales Entry”.NEXT = 0;
Please help anyone

Are you saying Item.“No.” in your code does not have a value? is it a dataitem somewhere or are you using a “GET”? like: if item.GET(Trans. Sales Entry".“Item No.” ) then …