sort a string

MarionD

Registered User.
Local time
Today, 10:23
Joined
Oct 10, 2000
Messages
425
Hi all,

A
I am trying in VB to sort a variable txtstring and return as a string the result.

For example I have:

txtstring="B,A,C" (or 1c,1a,1b or just numbers "3,7,2,1,4,5,6")

And I would like to sort the string to read

txtstring="A,B,C"

I have tried the split function, but am not quite sure what it is supposed to do.

Any help would be much appreciated
Thanks
Marion
 
you will need to use the split function probably

the split function produces an array of the separate items

then you need

a) to resort the array and
b) generate a new sorted string

it begs the question why the data looks like this, though, because this is not normalised data
 
Hi there,

The data looks like this because I'm busy with a data conversion to be able to use my programm. The old data has been imported from a .dbf file, and I'm converting it into my "normalised" mdb.
Thanks for the answers - I've solved the problem by writing the data out into a temp table, creating a recordset, sorting it and reentering into my db.

Marion
 

Users who are viewing this thread

Back
Top Bottom