Hi there,
I've got a question on how to read some datarows.
There are 2 tables,
table A is called invoice (fields: itemID, itemUsedID, price)
table B is called item (fields ItemID, itDate, contract)
Example:
Table A: itemID: 5 - itemUsedID 6 - price 7
itemID: 5 - itemUsedID 7 - price 9
Table B: IDb : 5 - iDate Sep 12 - contract X
This is quite simple, just to demonstrate what I am looking for.
I want to get the invoice from table A (more then 1 entry per itemID possible) which is filtered by the date from table B
"Show me all invoices from table A which have a date before end of August" or something like that.
I am not sure whether LINK or FILTER is the correct choice, but I have tried various - nothing which worked.
My latest function looks like that:
=NL("rows";"Invoice";;"LINK=";"item";"itemID";"=ItemID";"iDate";"140909..150909")
Plain and simple. But there are going to show up thousands of entries, which should be more like tens of entries…
Does anyone has an idea what my mistake is or even better how to fix it? ;-)
Thanks in advance
1 comment
-
Jet Reports Historic Posts Cyrrel,
I used a SQL statement linking the tables, with a WHERE %FILTER1% statement. See below.
SQL= SELECT SUM(OpenItems.BalDue) as 'TOTAL' FROM Lease INNER JOIN OpenItems ON Lease.PropertyId = OpenItems.PropertyId AND Lease.BldgId = OpenItems.BldgId AND Lease.UnitId = OpenItems.UnitId AND Lease.ResiId = OpenItems.ResiId WHERE %FILTER1%
Then my function statement looked like this ($S$4) in the statement references the SQL statement
=nl(,$S$4,"Total","1s=OpenItems.PropertyId",$B21,"1s=Lease.ResiStatus","C","1s=OpenItems.IncCode","RENT",,,"1d=OpenItems.ItemDueDate",">=9/1/2009","1d=OpenItems.ItemDueDate","<=9/30/2009")
Don't know if this is what you are looking for…
Gary