runswithsizzors
Well-known member
I have a situation where I keep track of telephone poles. Each pole has a distance between them. I group them by the conductor that is on the poles. When the conductor changes the distance between the poles is reset.
here is my SQL Expression Field
(SELECT pole_number
FROM project_lines
WHERE line_code = (select min(line_code) from project_lines WHERE mainline_conductor_code = "project_lines"."mainline_conductor_code"))
*Note: This is for the first pole in the line hence the min(line_code)*
Where "project_lines"."mainline_conductor_code" is I need to evaluate each detail and that "project_lines"."mainline_conductor_code" changes.
My question is there any way to pass in variables into a SQL Expression Field?
If I can pass in a variable that line would work. As it stands it grabs the last conductor in the database and I need to do it for each conductor. Even if I filter by mainline_conductor_code at the report level it still gets the last conductor in the database.
Thanks!
here is my SQL Expression Field
(SELECT pole_number
FROM project_lines
WHERE line_code = (select min(line_code) from project_lines WHERE mainline_conductor_code = "project_lines"."mainline_conductor_code"))
*Note: This is for the first pole in the line hence the min(line_code)*
Where "project_lines"."mainline_conductor_code" is I need to evaluate each detail and that "project_lines"."mainline_conductor_code" changes.
My question is there any way to pass in variables into a SQL Expression Field?
If I can pass in a variable that line would work. As it stands it grabs the last conductor in the database and I need to do it for each conductor. Even if I filter by mainline_conductor_code at the report level it still gets the last conductor in the database.
Thanks!