Notifications
Announcements
No record found.
Hi guys,
i have a list of itqan number record, now i want to get sum of itqan number but it is that a string field how to get in x++ sum of string field.
give us an alternative way.
thanks.
You can't perform mathematical calculations on strings, only on numbers. As you can imagine, calculating "apple" + "blue" would not make any sense.
So, you must first convert the string to a number (int or real) and then do your calculation.
Thank you quickly for the response,
i already know it is not possible but in my itqan number Like : 1007 to 4447.
anyway i will try to convert.
Sorry for my bad knowledge, but can you explain a bit what these itqan numbers are? I tried to google "what is itqan number" but could not find any information.
Even if i convert to a str2real then how to do the select queries give us a small example.
You need to store them in numeric format in the database in order to use them in select / sum database operations.
So, if your user inputs a string in a table field and you want to treat it as a number later on, you need to convert it when the record is inserted/updated and store it in a numeric field in your table.
You can't use X++ functions is SQL queries. You'd have to fetch what you have in DB (= strings), iterate records, convert values to numbers and summarize the values in the application layer.
You could also create a view with a computed column doing the conversion and then sum this view.
But I don't recommend either - the actual problem is in your data model. When you use a correct data type in your data model, summarize the values will become trivial.
Hi Riyas,
Is itqan numbe a fixed format?
Could you use strreplace("1007 to 4447.", "to", ",") to change the format?
Hope this helps.
regards,
QianQW
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 503 Most Valuable Professional
André Arnaud de Cal... 434 Super User 2025 Season 2
BillurSamdancioglu 278 Most Valuable Professional