I want to show commenst from the "Comment Line" table, last first. But, because of the layout of the Excel-doc I can't use rows.
I have 32 cells in a column and want to show the following:
A1: the last comment line with job = 4851
A2: the second to last comment line with job = 4851
A3: the third to last comment line with job = 4851
..
..
Number of comment lines can vary depending on the job no, from 0 to 32.
Any ideas?
Thanks!
6 comments
-
Jet Reports Historic Posts Official comment Hi Indahla,
In the NL function you may use a number to indicate which record you wish to retrieve from the database. Positive numbers are used to begin at the start, negative numbers to start at the end.
In your case it would be something like:
A1 NL("-1","Comment Line","Comment"….your filters)
A2 NL("-2","Comment Line","Comment"….your filters)
A3 NL("-3" etc etc)
(p.s. be aware that Jet will use Colum A and Row 1 for it's Auto procedure. it is a good idea to move your functions to a different column)
Does this work for you? -
Jet Reports Historic Posts Hi and thanks for a quick reply.
Sorry it doesn't work.
I do this:
AM44:=NL(-1;"Comment Line";"Comment";"Table Name";"job";"No.";4851)AM45:=NL(-2;"Comment Line";"Comment";"Table Name";"job";"No.";4851)Both gives the same result: "Dette er en test 123"
The table with filter No. = 4851:
Table Name No. Line No. Date Code Comment
Job 4851 10000 30.10.11 REV06 Dette er en test 123
Job 4851 20000 30.10.11 REV06 Dette er en test 1234
Job 4851 30000 30.10.11 KALK test, test KALK
What am I doing wrong? -
Jet Reports Historic Posts Hi,
Did you actually run the report (by using the Jet -> Report button)? Typically I believe you have to run the report to get the correct result for a function like this (Jet optimizes its queries in design mode so that you can write reports more quickly).
Regards,
Hughes -
Jet Reports Historic Posts No, I didn't. :oops:
I'll try that now. -
Jet Reports Historic Posts It works!! Thank!!
-
Jet Reports Historic Posts Why you not using:
NL("Rows";"Comment Line";"Comment";"Table Name";"Job";"No.";"4851";"-Line No.";"*") < notice the - for descending sort.
This way with either 1 or 32 rows it works correctly.