split field

kolait

Registered User.
Local time
Today, 07:48
Joined
Oct 11, 2019
Messages
60
hi
How to split an Access field into several parts?
for example
Divide the numbers below into several fields
2343256787
657876
9876545673
 
What rules govern the split process? Options include Left(), Right(), Mid().
 
The number of digits is different
 
Huh? What do you expect to be the results from each of those numbers?
 
I want the numbers in the report to be in this table
 

Attachments

  • 72.png
    72.png
    31.6 KB · Views: 110
Hi. If you can give us the rules for splitting your data, we can help you convert it to code.
 
So 1 character per field? You're probably going to have to loop the characters, but I don't feel I have enough info to get more specific.
 
I'll get out of the way.
 
I have to write the numbers separately in the report. How do I separate numbers? With text functions? Or is there a special code? The number of character numbers is one to ten
 
I have to write the numbers separately in the report. How do I separate numbers? With text functions? Or is there a special code? The number of character numbers is one to ten
Hi. So, if you're saying the "rule" is to separate the digits of a long number, then maybe you could take a look at this as a start. Hope it helps...
 
If you have a string of digits as individual characters, you would use the Mid() function and here is a description of how to use it.

https://support.office.com/en-us/article/mid-function-427e6895-822c-44ee-b34a-564a28f2532c

If you have a numeric field (i.e. data type is NOT Short Text or Long Text) and you want to pluck the digits out of it in some manner, you might first convert the number to a string with Stringvar = CStr(number), after which you would apply the Mid() function anyway. Note that if this is all you want, I would use Cstr() and not Str() because Str() includes a leading space for positive numbers.

If you were worried about a specific number of digits in the string, we would have to know more about the requirements, but in general that would involve using the Format() function to make the string have that many characters.

Your answer will be somewhere in there, but (apologies) your question was too vague for me to clearly see what you wanted.
 

Users who are viewing this thread

Back
Top Bottom