question

ana.pc2 avatar image
0 Likes"
ana.pc2 asked Jeff Nordgren commented

Query problems for Pulling

Hello! How are you all?

I am trying to code a query but I think I am having some troubles with the format of the string since the label Name is a mix of numbers and letters (Example: 67HYK). And if I leave it with only numbers, the query works, so I am guessing thereis where my problema is.

The label Name is a concat of two other labels, for example: ítem.label1 = 67, and ítem.label2 = HYK, and then ítem.Name = 67HYK (ítem.label1 + ítem.label2)… just in case this could be the problem.


I am pulling from a list with label Name, and this is my idea of the code but I get an Invalid pull query error, so I guess the error could be on this line:


string bname1 = Model.find("P1").Name;
string bname2 = Model.find("P2").Name;
string bname3 = Model.find("P3").Name;

string queryStr = "WHERE Name !=" + bname1 + " AND Name !=" + bname2 + " AND Name !=" + bname3 + " ORDER BY age DESC";

...

pulled = list.pull(queryStr, 1, addToBackOrders ? 1 : 0, current, partitionId, (removeFromList ? 0 : LIST_DO_NOT_REMOVE) | LIST_RETURN_BACK_ORDER_IF_NOT_FULFILL);


Any ideas to fix it??? Thanks! :)

FlexSim 20.2.3
flexsim 20.2.3pull from listpull requirement
· 7
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

ana.pc2 avatar image
1 Like"
ana.pc2 answered Jeff Nordgren commented

Oh, I think I got it. In case someone need it, this is how I fixed it:

Basically I changed all labels to numbers and use Variant instead of string...

I still wonder why it doesn't work with a string (mix of letters and numbers).

· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.