Currently I am running in the following challenge. I have a subform on the table 'pakbonitem' with the primary key 'pakbonitem_id'. Within this subform I have a lookup-object with the ID 'pakbonitem_artikel_id' which has the 'artikel_id' as its description. Per row in the subform I want to do a display SQL-query based on this 'artikel_id'/'pakbonitem_artikel_id'. Currently my SQL code is looking as follows, but it is not working:
SELECT
ROUND(SUM(pakbonitem_aantalgeleverd), 0)
FROM
pakbonitem
WHERE
pakbonitem_artikel_id = '#pakbonitem_artikel_id#'
I have tried every #SQL-parameter# that I could think of, but nothings seems to make it work. Do a need a more complicated work around or should a display calculation within a subform be possible? Thanks in advance for your help, appreciate it a lot.
Hi Steven, thanks for your reply! I already tried to use the debugger and the issue is that it doesn't recognize the parameter as a parameter. Parameters that I use from the main form (table 'pakbon') work, but the parameters I try that are within the subform (table 'pakbonitem') will keep the #'s in the debugger.
SELECT
SUM(pakbonitem_aantalgeleverd)
FROM
pakbonitem1234 WHERE
pakbonitem_pakbon_id IN (
SELECT pakbon_id FROM pakbon WHERE
pakbon_datum < '#pakbon_datum#' AND
pakbon_orders_id = '#pakbon_orders_id#')
AND pakbonitem_artikel_id = '#pakbonitem_id#'
SELECT
SUM(pakbonitem_aantalgeleverd)
FROM
pakbonitem1234 WHERE
pakbonitem_pakbon_id IN (
SELECT pakbon_id FROM pakbon WHERE
pakbon_datum < '2025-05-01' AND
pakbon_orders_id = '55000009')
AND pakbonitem_artikel_id = '#pakbonitem_id#'
These #'s of the last parameter stay like this, for every parameter I tried that it could possibly be. Thanks!
SELECT pakbonitem_artikel_id FROM pakbonitem WHERE pakbonitem_id = '#RECORD_ID#'
However, I want to use the 'pakbonitem_artikel_id' in the filter option of a run-object. But since I was not able to retrieve this as a hash-cookie it doesn't work. Using the #RECORD_ID# as the filter-cookie within the run-object doesn't do what I need.
If you can add a JOIN in your SQL statement that links to the sub form item, then you can use the hash cookie #RECORD_ID# to link back to the field that you want to display.