Does table sql queries have a function like substr?

Does table sql queries have a function like substr?

yexioamu
Not applicable
4 Views
2 Replies
Message 1 of 3

Does table sql queries have a function like substr?

yexioamu
Not applicable

[ FlexSim 21.2.4 ]

I need to extract the second letter in a column of a table for a complex sql, the substr function and substring function is not work, what can i do for it?

0 Likes
Accepted solutions (1)
5 Views
2 Replies
Replies (2)
Message 2 of 3

moehlmann_fe
Observer
Observer
Accepted solution

Dot-syntax and methods/commands using square brackets don't work in queries. You can setup user commands though that return the wanted value.

In this case you can also use the deprecated command "stringpart()".

Table.query("SELECT stringpart([Col], 1, 1) FROM GlobalTable1").cloneTo(Table("GlobalTable2"));
0 Likes
Message 3 of 3

yexioamu
Not applicable
thank you! it works, but it has a point to note, the second parameters, the num start, countsing starts from zero.
0 Likes