Extract specified characters from customer details

so my question is:

how to extract a set of characters from string and match it to check?
like i hav sector:F-9,F-10,F-11 and so on
so how t
i extract f-9 from customer details sector column and check if it ‘F’ or not

Where? For what? In a Rule? In a Template? In a Report?

Show a screenshot of one of your Customer data details, and explain how/when/where you want to “extract” the information.


I have customers from different sectors. Like F-9
Like this…
When adding customer details i have customers addresses stored along with sectors.
Like 29/D, marine apartments, F-9

I want to print a report for all the customers from F-9.

Substring is not working. I want to extract F-9 from customer address


Ok, so we have a general idea of what you’re trying to do now. However, more detail is needed.

Give an example of the Report output you wish to achieve.

Not working where? In your Report? Show what you have done. Show what you want.

Finally, again, show actual screenshot of 1 or 2 Customer Entities that contain some data in the Custom Data Fields.

You could define a custom entity field for sector.
I have ‘zone’ field for tables for bar, lounge, restaurant and conservatory which I use for dynamic text fields on entit screen under the page selectors at top displaying the number of open tickets for entities based on their zone;

Ok i dunno if im been more clearer… so sorry
But i use substring and Mid() all the time in sql.
You like 12345fgh7890
I use mid() to extract fgh from the string.

But these function dont work in sambapos.
I need their equivalent functions in sambapos to extract my desired content from within the fields.

But they do work in sambapos. V5 supports it. Upgrade to V5 and you can do what your asking.

I just used it myself.

Ohh Thank you so much for your prompt replies. Its a life saver.
No wonder I cudbt use it. I have version 4. So in my sql query im not able to use it.

Anyway i can do something in sql query in samba v4 to get my desired output

It’s doubtful. V4 is limited with that.


i did this
Help taken from kendash’s report
> min(substring(
> Cast(TE.EntityCustomData as nvarchar(4000)),
> CharIndex(’{“Name”:“Sector”,“Value”:"’,cast(TE.EntityCustomData as nvarchar(4000)))+26,
> CharIndex(’"’,cast(TE.EntityCustomData as nvarchar(4000)),
> CharIndex(’{“Name”:“Sector”,“Value”:"’,cast(TE.EntityCustomData as nvarchar(4000)))+26)
> - CharIndex(’{“Name”:“Sector”,“Value”:"’,cast(TE.EntityCustomData as nvarchar(4000)))-26)
> ) as [Sector]


1 Like