Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unable to sort 3 arrays in parallel 1

Status
Not open for further replies.

Halliarse

IS-IT--Management
Jan 8, 2007
213
GB
I have an interesting conumdrum which I haven't been able to resolve!

I have 3 arrays which I need to sort in parallel, are as follows and have sample data as supplied

EventDate = "04/11/2015,04/11/2015,05/11/2015,05/11/2015,08/11/2015"
Stylist = "Tracey,Michelle,Tracey,Michelle,Michelle"
EventTime = "09:00,09:00,09:00,08:00,09:00"

The sort order is by EventTime, By Stylist within EventDate so the result should be as follows

EventDate = "04/11/2015,04/11/2015,05/11/2015,05/11/2015,08/11/2015"
Stylist = "Michelle,Tracey,Michelle,Tracey,Michelle"
EventTime = "09:00,09:00,08:00,09:00,09:00"

Any ideas on how the code should look for this please?

Many thanks

Steve
 

>The sort order is by [blue]EventTime[/blue], By Stylist within EventDate so the result should be as follows

[pre]
EventDate = 04/11/2015 04/11/2015 [blue]05/11/2015[/blue] 05/11/2015 08/11/2015
Stylist = Michelle Tracey [blue]Michelle[/blue] Tracey Michelle
EventTime = 09:00 09:00 [blue]08:00[/blue] 09:00 09:00
[/pre]
It does not look right to me.
[blue]Michelle[/blue] in the middle is the only one with the EventTime of 08:00 so shouldn't she be the first one?

Anyway, I would dump all the data into a simple little table and sort it from there:
[pre]

EventDate Stylist EventTime
04/11/2015 Tracey 09:00
04/11/2015 Michelle 09:00
05/11/2015 Tracey 09:00
05/11/2015 Michelle 08:00
08/11/2015 Michelle 09:00
[/pre]

Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top