473,473 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Specific Sorting Requirements

21 New Member
Greetings all!

I am attempting to complete a sort option on a report. I want to be able to show all records in ascending order of each subset of categories. In other words, I will have different "Locations" where items are going to be stored on shelves. They are labeled by the alphabet- A, B, C, D, E and so on. However I have "sub levels" such as A1, A2, A3, A13, A64 and so on.

The problem I am running into in the report is it is listing the categories and it's sub levels as A1, A10, A11, A12, A13, not like I want them to- A1, A2, A3...A10, A11,...A20

Is there a workaround for this problem? Any help would be greatly appreciated!!

Much thanks!
Adam
Feb 21 '08 #1
5 1639
Stewart Ross
2,545 Recognized Expert Moderator Specialist
The problem I am running into in the report is it is listing the categories and it's sub levels as A1, A10, A11, A12, A13, not like I want them to- A1, A2, A3...A10, A11,...A20
Hi Adam. The sort is working correctly, for alpha characters (A10 is indeed a lower sort value than A2 in terms of character ordering) - after all, the sublevel is not a number, but a text string.
If the sublevel number is already available directly as a number in your base query you need to sort the report on the overall category then the level number separately.
I suspect the sublevel number isn't available in your base query or you would already have tried this. If this is so add a calculated field to the underlying query which extracts the level number as a number (substituting the name of the actual field for [SubLevel Field Name] below):
Expand|Select|Wrap|Line Numbers
  1.  
  2. LevelNo: Val(Right$([SubLevel Field Name], Len([SubLevel Field Name])-1))
  3.  
In your report's sorting you will then need to sort on the category then on LevelNo to get the sorting as you want it to be.

-Stewart
Feb 21 '08 #2
blad3runn69
59 New Member
the problem might lie with the way access is interpreting your sublevels, as Stewart pointed out. there is prob a smarter way to do it...
Feb 21 '08 #3
NeoPa
32,556 Recognized Expert Moderator MVP
Another way would be to format the sublevel name to include zeroes to the number of places of the maximum value.
Say your sublevels go from A1 to A69, B1 to B69, etc. You could then store them as A01 to A69, B01 to B69, etc.
Obviously, if the maximum value were 720 instead of 69 then you'd need three digits for the number - A001 to A720, etc.
Feb 22 '08 #4
awojciehowski
21 New Member
Thanks everyone for your help...I chose NeoPa's suggestion on just adding a zero before the numbers. That was the easiest fix...so common sense.

Thanks again!
Feb 25 '08 #5
NeoPa
32,556 Recognized Expert Moderator MVP
Our pleasure :)
All ideas help in that they get the brain going. I like to store them away for other situations in future.
Feb 25 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Pratyush | last post by:
Hi, Suppose there is a vector of objects of class A, i.e., std::vector<A> vec_A(N); The class A satisifies all the STL vector requirements. Now I wish to add some attributes for each of the...
63
by: Tristan Miller | last post by:
Greetings. Do any popular browsers correctly support <q>, at least for Western languages? I've noticed that Mozilla uses the standard English double-quote character, ", regardless of the lang...
40
by: Elijah Bailey | last post by:
I want to sort a set of records using STL's sort() function, but dont see an easy way to do it. I have a char *data; which has size mn bytes where m is size of the record and n is the...
1
by: Laurence Nixon | last post by:
Hello all. I am seeking ideas on how to determin a specific value with varied parameters. This will be for students who have taken modules in a course for pre-certification. So it will be like...
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...
18
by: Scott | last post by:
I have a collection where the items in the collection are dates. I want to iterate over the collection and build a value list string for the rowsource of a listbox. The dates in the collection are...
1
by: tfsmag | last post by:
Hello, I have a function that returns a dynamically created gridview. This works fine, however it does not seem to be able to maintain state when adding sorting or paging to the gridview. Does...
11
by: garyhoran | last post by:
Hi Guys, I have a collection that contains various attributes (stuff like strings, DateTime and Timespan) . I would like to access the collection in various orders at different points in the...
1
by: ECD | last post by:
Hello all, I can usually find solutions to my .NET problems by searching these groups, but I'm stumped on this one. I have a datagrid in VB.NET (2.0 framework). I want to disable sorting on...
18
by: =?ISO-8859-1?Q?Ney_Andr=E9_de_Mello_Zunino?= | last post by:
Hello. It seems a year is all it takes for one's proficiency in C++ to become too rusty. Professionally, I've been away from the language (and from programming in general), but I still preserve...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.