Concatenate Query Results into One Cell

New Contributor

I am in the process of building a simple worksheet or so I thought. The purpose of the sheet is for a sales associate to use a barcode scanner to scan many items into A2 through A?. Each time C? is filled, I desire a query to be executed using the IBM Informix ODBC connection that is already set up as a DSN to return the available inventory into F?.


A2 = Empty cell to receive data from barcode scanner
B2 = Time Date Stamp when A2 is populated = Accomplished
C2 = LEFT 6 of A2 = Accomplished
D2 = HYPERLINK to web-server based on data in C2 = Accomplished
E2 = Text version of Hyperlinked URL = Accomplished


The challange I'm failing at = F2


When cell C2 is populated I would like to be able to use its "value" as the value in place of "C2" in the following Informix database select query. As a sort of variable if that makes sense.



SELECT (item_size_id || "/" || item_size2_id || " >" || on_hand_qty || "<")
FROM item_stores
WHERE item_id = 'C2'
AND store_id = '001'
AND on_hand_qty != '0'



I would like to fill cell F? with the results of the query. Other than not understanding enough to accomplish this, my challenge is that this query will likely return several rows of data. So, I am also at a loss as to how one might concatenate the potential many rows of data returned into just cell F2.


Is this possible? I'm asking because this is way over my head, thank you in advance for even taking the time to contemplate this or how one might do it without hundreds of queries firing off when the sheet is refreshed.

2 Replies

@Casey Popp 

Or if concatenating the query results into one cell is to much of a problem, could the results be populated into the cells F2, G2, H2, etc..., Cells starting at F? and working right. This would be more ideal anyway.



@Casey Popp  Did you ever figure out how to do this?