Defining/Naming a Data Source and using it in a subquery (where clause) to display multiple records in a table Folgen

0
Avatar
marco nicolayevsky

Hello all,

I am trying to create a pick ticket in Bartender 2021. I have created the data source as a custom query that grabs order numbers based on open status and displays order record information on the header of the page. This part is easy/straight-forward. I have named this field "MySO" with the "assumption" that I would be able to call on this variable from within the table custom query.

I have a custom SQL statement to populate the table and this works without any issues so long as I dont specify a WHERE clause. Essentially, it displays all items, which is fine to validate the table display.

Now I'm trying to link the order number, which is part of the current record, to the table query. From reading posts and googling, i've found references to being able to use named data sources by enclosing them in ampersans "&" such as this:

WHERE SUBSTRING(PICK.NUM FROM 2 FOR 50) = '<&MySO&>'

I have experimented with using '&MySO&', '"&MySO&"', '<&MySO&>', and any other permutation I can think of with no success.

Can someone please help?

 

1 Kommentare

0
Avatar
Pete Thane
Aktionen für Kommentare Permalink

Not sureyou can use that method and I would normally use a Database Filter and so you would end up with something like this

FROM `Excel`.`NEW PRICE LIST` WHERE `TYPE` LIKE '?QueryPrompt1%'

I did not change the name of my query prompt and so it is referencing the default name (QueryPrompt1) but perhaps you could try adding something similarly formulated to your custom statement. Saying that wouldn't the value of MySO be empty until after the database look up has been carried out?  

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.