473,395 Members | 1,941 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Sorting or Grouping problem

RR
How could I make a text field sort in the following way?

2CBE00001 2CBE00001
2CBE00002 2CBE01001
2CBE00003 2CBE02001
2CBE01001 2CBE00002
2CBE01002 2CBE01002
2CBE01003 2CBE02002
2CBE02001 2CBE00003
2CBE02002 2CBE01003
2CBE02003 2CBE02003

Any help would be greatly appreciated
Thanks
Dave
Nov 13 '05 #1
4 1123
Dave,

If characters 1 through 5 and 7 through 8 are truly constant then this will
do the sort.

SELECT Field1 FROM Table1 ORDER BY Mid([Field1],9,1), Mid([Field1],6,1);

Linda
"RR" <dl********@prodigy.net> wrote in message
news:4q***************@newssvr32.news.prodigy.com. ..
How could I make a text field sort in the following way?

2CBE00001 2CBE00001
2CBE00002 2CBE01001
2CBE00003 2CBE02001
2CBE01001 2CBE00002
2CBE01002 2CBE01002
2CBE01003 2CBE02002
2CBE02001 2CBE00003
2CBE02002 2CBE01003
2CBE02003 2CBE02003

Any help would be greatly appreciated
Thanks
Dave

Nov 13 '05 #2

"RR" <dl********@prodigy.net> wrote in message
news:4q***************@newssvr32.news.prodigy.com. ..
How could I make a text field sort in the following way?

2CBE00001 2CBE00001
2CBE00002 2CBE01001
2CBE00003 2CBE02001
2CBE01001 2CBE00002
2CBE01002 2CBE01002
2CBE01003 2CBE02002
2CBE02001 2CBE00003
2CBE02002 2CBE01003
2CBE02003 2CBE02003

Any help would be greatly appreciated
Thanks
Dave


Dave, you haven't made what you hope to accomplish very clear. Is it that
you want it sorted by the last four characters in reverse sequence? Or,
perhaps the last 5?
Nov 13 '05 #3
Maybe it's really a problem in pattern recognition?

"Randy Harris" <ra***@SpamFree.com> wrote in message
news:mC**********************@newssvr28.news.prodi gy.com...

"RR" <dl********@prodigy.net> wrote in message
news:4q***************@newssvr32.news.prodigy.com. ..
How could I make a text field sort in the following way?

2CBE00001 2CBE00001
2CBE00002 2CBE01001
2CBE00003 2CBE02001
2CBE01001 2CBE00002
2CBE01002 2CBE01002
2CBE01003 2CBE02002
2CBE02001 2CBE00003
2CBE02002 2CBE01003
2CBE02003 2CBE02003

Any help would be greatly appreciated
Thanks
Dave


Dave, you haven't made what you hope to accomplish very clear. Is it that
you want it sorted by the last four characters in reverse sequence? Or,
perhaps the last 5?

Nov 13 '05 #4
Squirrel wrote:
Dave,

If characters 1 through 5 and 7 through 8 are truly constant then this will
do the sort.

SELECT Field1 FROM Table1 ORDER BY Mid([Field1],9,1), Mid([Field1],6,1);

Linda
"RR" <dl********@prodigy.net> wrote in message
news:4q***************@newssvr32.news.prodigy.com. ..
How could I make a text field sort in the following way?

2CBE00001 2CBE00001
2CBE00002 2CBE01001
2CBE00003 2CBE02001
2CBE01001 2CBE00002
2CBE01002 2CBE01002
2CBE01003 2CBE02002
2CBE02001 2CBE00003
2CBE02002 2CBE01003
2CBE02003 2CBE02003

Any help would be greatly appreciated
Thanks
Dave


Or....

SELECT Field1 FROM Table1 ORDER BY Right([fieldname],1) ASC,
Mid([Field1],6,1) ASC
Nov 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Mat N | last post by:
Hi, I've been trying to work out how to create a report based on crosstab query for which the number of fields is variable. For example in a situation where you show customer billing by year in...
8
by: Mike MacSween | last post by:
tblCourses one to many to tblEvents. A course may have an intro workshop (a type of event), a mid course workshop, a final exam. Or any combination. Or something different in the future. At...
4
by: Marie | last post by:
My report has a text field named ItemNum. Most records have a value for ItemNum. I set Grouping And Sorting to sort ascending on the ItemNum field. The records where ItemNum is Null appear at the...
5
by: Mike | last post by:
Hello All, I have a report based upon a query. I have added a control to report footer that calcs the total cost of the inventory: =SUM(). When this total calculation is NOT on the report,...
8
by: nn0410 | last post by:
I have a report whose record source is a query. The query includes an ORDER BY clause that sorts on a particular set of columns. I would like to be able to run the same report with the same input...
6
by: Christoph | last post by:
I'm trying to come up with a stylesheet where, when the rows are displayed, duplicate game names are not shown on subsequent rows. It works but doesn't work properly. If I sort the data using...
3
by: Jimmy | last post by:
Is there a way to sort/group a report based on the second column of a combo box, i.e. the text associated with the primary key number?
3
by: Don | last post by:
I have a "Report" that is created from a "Form". It prints a list of items, you may consider it a shopping list. In any event I use to run this in alphabetical order but have since decided to run...
8
by: sara | last post by:
Hi - I have looked at all posts and tried both Allen Browne's Report Sorting at run Time ( Select Case Forms!frmChooseSort!grpSort Case 1 'Name Me.GroupLevel(0).ControlSource = "LastName"...
4
by: kstevens | last post by:
I have a report, and on the report is a min, avg, and max query each with (ok who really cares) 20 or so records. At the footer of the report i would like to have a total. I requery for each...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.