473,394 Members | 1,701 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,394 software developers and data experts.

Sorting multiple fields in queries

I am so aggravated and need any help I can get. I am using Access 2000
and am trying to sort multiple fields in a select query.

My query is set up as follows:
FIELD 1 FIELD 2 FIELD 3 FIELD4 FIELD 5 FIELD 6
MSA03 MSA 02 % change ICU 03 ICU 02 % change
calc. calc.

This format continues and in some queries I have up to 13 percentages
to sort. I need to sort each percentage to show over 20% increase and
have only those records with an increase show.

I've tried using >=.2 as the criteria in each percentage field, but
that doesn't give me what I need.

(I know this looks like it should have been done in Excel, but for
reporting/printing purposes it had to be done in Access.)

Any help is greatly appreciated.
Thank you

Nov 13 '05 #1
3 3438
Tesc,
Behind the scenes the QBE grid is writing an SQL statement for you. To
define the sort order of a query it uses (and you can use) an ORDER BY
clause in the SELECT statement. If you want to limit the rows returned in a
result to only those that meet a set of criteria, then you would include a
WHERE clause.
So, for example, "SELECT [FIELD 1], [FIELD 2], [FIELD 3], [FIELD4], [FIELD
5], [FIELD 6] FROM TABLE1 WHERE [FIELD 1] >=0.2 OR [FIELD 2] >= 0.2 OR
[FIELD 3] >=0.2 OR [FIELD 4] >=0.2 OR [FIELD 5] >=0.2 OR [FIELD 6] >=0.2
ORDER BY [FIELD 1].

And a gripe--Naming your fields [FIELD 1], [FIELD 2], etc. is lazy & rude.
Hopefully no one else has to use the table set up this way. Hopefully the
table won't be in service long enough for you to forget what each field
contains. But bitter experience by many database administrators has taught
that failing to make the effort to name fields something sensible begets
hours of hair pulling and teeth gnashing by the users and administrators of
such a database. Make the effort to name your fields.

<te**@optonline.net> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
I am so aggravated and need any help I can get. I am using Access 2000
and am trying to sort multiple fields in a select query.

My query is set up as follows:
FIELD 1 FIELD 2 FIELD 3 FIELD4 FIELD 5 FIELD 6
MSA03 MSA 02 % change ICU 03 ICU 02 % change
calc. calc.

This format continues and in some queries I have up to 13 percentages
to sort. I need to sort each percentage to show over 20% increase and
have only those records with an increase show.

I've tried using >=.2 as the criteria in each percentage field, but
that doesn't give me what I need.

(I know this looks like it should have been done in Excel, but for
reporting/printing purposes it had to be done in Access.)

Any help is greatly appreciated.
Thank you

Nov 13 '05 #2
Thank you for your response and the spanking. My fields are named
properly. I listed field names and numbers for illustrative purposes
only.

Nov 13 '05 #3
Thank you for your response. My fields are named properly, MSA 03, MSA
02, MSAPCT and so on. I included the field numbers for illustrative
purposes only.

Thanks again.

Nov 13 '05 #4

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

Similar topics

3
by: Paul Kirby | last post by:
Hello All I am trying to update me code to use arrays to store a group of information and I have come up with a problem sorting the multiple array :( Array trying to sort: (7 arrays put into...
3
by: Gord | last post by:
I would like to create a summary report from the results of 11 queries (based on 2 tables). All the queries have the same format and return 3 numbers (Count, Current Year Bal, Last Year Bal.)...
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...
3
by: alex_peri | last post by:
Hello All, I am having problems with sorting a recordset by fields in Access. I have a table with three columns called ID, SNo and Time and would like to sort the records by Time. I would like to...
0
by: MHenry | last post by:
Hi, I know virtually nothing about creating Macros in Access. I would appreciate some help in creating a Macro or Macros that automatically run(s) 14 Queries (three Make Table Queries, and 11...
2
by: Tarvos{k} | last post by:
Okay folks, I am back with another somewhat weird problem. I have a table that I am trying to run a query on that has the following fields: City, State, Zip Code, Population, Households. The...
11
by: dskillingstad | last post by:
I've been struggling with this problem for some time and have tried multiple solutions with no luck. Let me start with, I'm a novice at Access and I'm not looking for someones help to design my...
3
by: Neil Hindry | last post by:
I wonder if you can help me. I have setup an address-book database in Access XP. I have the first name & surname as separate fields. As I wanted to sort my database by surname and then by first...
8
by: Chris A via AccessMonster.com | last post by:
I have an interesting problem that I have yet to come accross that I can't change data structure on because it is an export from filemaker I am reformatting for another dept. anyway. I have a table...
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: 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
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...
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...

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.