Query to get multiple entries in a single line in order

dastr

Registered User.
Local time
Today, 22:11
Joined
Apr 1, 2012
Messages
43
Hi all,
I am trying to figure out a query that puts multiple entries in one line in order, pls see below:
Column A
Column A
4, 2, 1, 3
1,2,3,4
A, C, B, D
A,B,C,D


I have a table with column A, and it is important that before I start manipulating the data that it is in order.
Does any of you have any clues how I may achieve this?
Thanks in advance
 
I think I speak for everyone when I say, 'Huh?'

I don't know if the sample data you provided is the input or output of what you want. Could you post sample data from your table (along with field names above it) and a sample of what you want your query to produce based on the data in the table?
 
You'll need to do some coding for this. First step would be to put the field data in an array, which is simple enough with the Split function;

Code:
Dim vArray As Variant

vArray = Split(YourField, ",")

Then, you can sort the array using a custom function. You can find some examples here, here or here.

Once the array is re-sorted you can write the data back to your field.

Edit: Forgot the delimiter in the Split function on first post.
 
I'm with plog "Huh?"

If you want suggestions/recommendations to a problem, then describe the problem in plain English. Give an example or two of what you have and what you want/need.
If you experience an error message, please tell us what it is exactly.

If Beetle has divined your problem and has mystically resolved it - more power to both of you. For the rest of us, and for those who stumble upon your issue and solution in future, please describe the problem. And please confirm that the proposed solution or advice has worked.

This is not meant as a complaint against Beetle (Sean) - on the contrary his posts are always appropriate. I'd just like the poster (dastr) to read what he/she has written and see if there is anything more that could be added to help readers understand the issue.
 
If Beetle has divined your problem and has mystically resolved it - more power to both of you.

I'm not a mystic, but I work next door to one. I paid her 5 bucks and she told me what the OP wanted.:D

Kidding aside though, you're right about the vagueness of the post, I just took a guess that they have comma delimited values in a field and they want sort them (within the same field) in alpha-numeric order, so 4,2,1,3 becomes 1,2,3,4.

I could be completely wrong though. I'm not sure you can trust a mystic that'll give you an answer for $5.:D
 
Beetle, that mystic neighbour is a damn good one :)...and cheap, indeed that is the idea guys, apologies, but wrote the msg in Word and upon copying and pasting it something must have gone wrong, and yes, I did not check afterwards.
 

Users who are viewing this thread

Back
Top Bottom