I am trying to write a subquery where I sum the contents of a table, and return the result as a field on each detail line of report. The query looks something like this: SELECT(SUM(PIECES) as total FROM my_table WHERE workorder = 12345). Now, the 12345...if I type it in manually like the above...works correctlly. Since this is on the detail line of a report, the WORKORDER will be different for each line, so Im trying to pass the workorder from that line of the report over to sql...but its not working. Ive tried dozens of times, and cant find the right answer. I tried passing the actual field name that im displaying on the report, and that doesnt work. In this case...it just hangs for a very long time when Im trying to save the expression...then I end up killing it after 10 minutes or so of no response.
Any suggestions?