Sorting A Query
Feb 6, 2008
I am fairly new at relying heavily on Access for my programming. Problem: I have a telephone database with call detail for every call. I only want specific records, which I am pulling by selecting sort (in query design mode) for that particular field. I need to sort like you would in Excel (Column A first, Column B second, and etc). Can someone help direct me in the right path as to how I need to run a mulitple sort? Your help is much appreciated.
View Replies
ADVERTISEMENT
Mar 10, 2006
Hi all.
I've created a database which contains information about stores. I want to have the forms automaticly sorted by the department number.
I've tried to sort the table by department, but when I try to add a department, the sorting doesn't seem to affect the form at all.
Lets say I have department 1,2,3,6,7,8 in the form, and I add department 4, it will be the last post in the form. I want it to be the fourth, and so on..
I'd apreciate some help with this :) Thanks
Here's the database (http://www.access-programmers.co.uk/forums/attachment.php?attachmentid=12934&stc=1&d=1142018915&PHPSESSID=f730b7f11f6983965698faeacbe5a1ee)
View 5 Replies
View Related
Aug 9, 2007
I have a job database where I sort jobs by upcoming, inactive, closed and active. Each has a corresponding number 1-4 respectively. The main table I update the jobs in is the JOB TABLE. I print a weekly report for our weekly meeting but I only want the active jobs in the report. My question is: how do I perform a sort function in the query, so I will have only the active jobs in the database table show in the query? Thanks in advance! If more info is needed I wil post additonal.
View 4 Replies
View Related
Feb 1, 2007
I'd like to sort in my query - used to populate a combo box - first by name, and then by ID.
Is there a way to force Access to sort in a particular order? It seems like it starts sorting with the first field that's to be sorted, but I want it to start with field 2 and then sort by field 1.
View 2 Replies
View Related
May 13, 2005
I have a Duplicates Query that extract the following information from my Table
Name Surname DOB Joined
The query then extracts info such as...
Bill Smith 25:12:70 1999
Bill Smith 25:12:70 2005
Most of the time the 'Joined' field has the same year. But I need to find the ones where the year differs but the rest of the information is exactly the same. Because there is 15000 odd records to check, I thought that there would be a quicker way to check.
Could someone please assist me with this query if it is possible?
Thank you in advance.
View 1 Replies
View Related
Jul 12, 2005
I have a crosstab query where my column headings are the names of the months based on invoice dates.
what i currently have:
Month: MonthName(Month([AnnualIncome]![InvoiceDate]))
so this spits out April May and June in the column headings.
The problem is that it is sorting it alphabetically, not by the numerical value - so my column headings are coming out as april, june, then may. (I assume once I have july that will come in between april and june.)
Any help would be REALLY appreciated.
Thanks in advance.
View 4 Replies
View Related
Nov 9, 2005
I am having a problem sorting records in a query. I have about 5, 000 entries in a table and when I build my query based on certain fields, the numbers in certain columns are not in order although I use the sorting feature. ( e.g.) I have 5 columns with numbering data contained in the columns, and I have it set up to sort in ascending order, which it did, but I noticed that the Volume # column sorts the Volume numbers differently (see example below):
V. 1
V. 10
V. 11
V. 12
then it goes back to
V. 2
V. 3
V. 4
V. 5
V. 6
V. 7
V. 8
V. 9
It looks like it sorts anything with a 1 first then the rest later. How do I fix this?
Thanks.
View 3 Replies
View Related
Apr 28, 2006
Hi
I have a problem sorting some query data and I wonder if someone could help point me in the right direction.
I have a query with two columns, in the first column is a number (either 6 or 7) and the second is the name of a business. Eg
Column 1 Column 2
6 Pizzas & Co
6 Pizzas & Co
7 Pizzas & Co
6 IPM Ltd
7 IPM Ltd
6 Computer Sales Ltd
6 Computer Sales Ltd
6 Computer Sales Ltd
7 Computer Sales Ltd
7 Computer Sales Ltd
7 Computer Sales Ltd
7 Computer Sales Ltd
7 Computer Sales Ltd
And I want to produce some another query so that the output which looks like:
Column 1 Column 2 (6's) Column 3 (7's)
Pizzas & Co 2 1
IPM Ltd 1 1
Computer Sales Ltd 3 5
So for each company name, I am essentially doing a frequency count for all the 6's and 7's.
I think this must be relatively easy to do, but I am getting it wrapped around my head!
Many Thanks,
Lee
View 2 Replies
View Related
Nov 24, 2014
How to sort a subset in a query. I have three fields BatchID,Month and Year. The BatchID can have multiple months and years. I would like to order the final sort so as the Batchs appeared in the order of the highest date combination with in each Batch.
The following is the SQL of my first Query which establish's the lowest and highest date in each batch.
Code:
SELECT tblRevOnlySelYear.BatchID, tblRevOnlySelYear.OperatorID, Max([Year] & IIf(Len([Month])=1,0 & [Month],[Month])) AS Expr1FROM tblRevOnlySelYear
GROUP BY tblRevOnlySelYear.BatchID, tblRevOnlySelYear.OperatorID
HAVING (((tblRevOnlySelYear.OperatorID)=1))
ORDER BY Max([Year] & IIf(Len([Month])=1,0 & [Month],[Month]));
The next SQL is the second query which results in the Batchs in the correct order by year but the months are not correct.
Code:
SELECT tblRevOnlySelYear.BatchID, tblRevOnlySelYear.OperatorID, tblRevOnlySelYear.Month, tblRevOnlySelYear.Year, qryRevTest4_1.[1stDate], qryRevTest4_1.LastDateFROM qryRevTest4 AS qryRevTest4_1 INNER JOIN tblRevOnlySelYear ON qryRevTest4_1.BatchID = tblRevOnlySelYear.BatchID
WHERE (((tblRevOnlySelYear.OperatorID)=1))
ORDER BY qryRevTest4_1.LastDate;
View 8 Replies
View Related
Apr 3, 2007
I created a query which at first was simply to run a query which asks you for a drivers name, however we have decided that now we want to sort by the employee name as well as by a specified date range. I originaly had it set up to select the driver name with this in the criteria field in the Driver Name column:
[Enter Driver Name]
Then I tried to enter the following in to the criteria field in the date column:
Between [Enter Start Date: (Format MM-DD-YY)] And [Enter End Date: (Format MM-DD-YY]
However when I run the query it asks me for the date about 4 times, and then it goes to a blank report. I am sure I am not doing this properly somehow, anyone care to help out?
View 1 Replies
View Related
Feb 5, 2014
I have a query that pulls info from a table. One of my fields is frequency and in that field i have weekly, annually, daily, etc.
How can I make the query sort starting at the daily one and move out to annually?
View 2 Replies
View Related
Aug 1, 2015
I want to sort the results of a query as follows.
The query returns 4 fields
ID, Field1, Field2, Field3
For the first 500 rows I want to sort by Field1 with the remaining rows sorted by Field3.
I can identify the first 500 rows bi ID being less than 501.
I've done something similar where I've displayed a value of a field in a different order by coding something like
ORDER BY Iif([field3]=9, 0.5, [field3])
which sorts the 9's first followed by the rest in ascending order but can't work out what to do here.
View 14 Replies
View Related
Nov 6, 2006
Hi,
I have a query for a subform which is displayed in datasheet mode (see attachment). I've created a form based on a query and used it as a subform.
The "casenumbers" per clients are displayed from 1 and upwards, I would like to have them sorted Descending. So in the query I sorted them that way. When I run the query they are displayed in descending order. When I open the subform based on that query however it is not. I can sort descending anyway by clicking the column on which I want to sort and do it that way, but that becomes bothersome and it doesn't need to be that way.
Record source is ok:
SELECT KlantNAW.ClientNumber, CaseInfoTable.Casenumber, CaseInfoTable.DateInitialCall, CaseInfoTable.DateCaseCreation, CaseInfoTable.CaseAccepted, CaseInfoTable.[1stAppointmentDate], CaseInfoTable.DateCaseClosed, CaseInfoTable.About1 FROM KlantNAW INNER JOIN CaseInfoTable ON KlantNAW.ClientNumber=CaseInfoTable.ClientNumber;
Order by:
Casenumber DESC
I thought, well, lets create a new form based on the query to see if that changes anything, maybe I've changed something I shouldn't have.
But nope, same result.
How can make the form sort descending in datasheet mode?
View 1 Replies
View Related
Jul 27, 2014
I have a query where I ORDER BY ClientId, MatterId and Transdate. The result of the query is correct. All of the transdates are in ASC order within the Matter.
When I run the report for a MatterId the relative transactions are not sorted on transdate
Can there be something in the report that could be effecting the order of the transactions.
View 3 Replies
View Related
Mar 21, 2013
i intially, I wish to have attendance stats for 3 groups of people over 2 days in a report
i have the two queries for the raw data, but wish to combine into a report that will ultimately become a "dashboard" report for half a dozen queries., and can only get one or the other to work do i need to combine the queries into a summary query of sorts?
View 1 Replies
View Related
Dec 30, 2013
I currently have records that end with a letter and 2 numbers. For example, A1, A2, ... , A10, A11. When I try to sort my table/query by these values, A10 & A11 come before A2. It seems that it is sorting by the first digit shown. Is there any way to fix this quickly within table/query properties so that this can be displayed in proper numeric order?
View 7 Replies
View Related
Jan 28, 2015
I have a shell of my database in the below link for reference. I am trying to create a query for a report that will allow me to track charges and payments per client. Each charge has a ChargeID and each payment has a PaymentID. Multiple payments can be applied to one charge so the same ChargeID can show up multiple times with a different PaymentID. Payments that are catagorized as Third Party Payments will have not only a PaymentID, but a TPPaymentID.
What I need to do in the query and final report is track the total charges (even though the ChargeID may show up multiple times, I only want the charge itself to be calculated once and the charge to only be listed once for each client) and track the total payments as well as sum the total payments for each charge for each client.
View 9 Replies
View Related
Sep 16, 2013
I have created a form based on a query. The funny thing is when I tried to sort fields on the form, the following message box pops up:
Syntax Error (Missing Operator) In (Field Name)
I just did the exact same thing several weeks ago, and that first form could sort fields normally. The only difference between the first one and this is that this second query was based on several tables, while the first was based on a single table, although I doubt that is where the problem is.
I forgot to add that I could sort fields where the field name doesn't have spaces in it. For example, the field name "Customer ID" triggers the syntax error, while the field "S/N", "Company", etc. can be sorted like normal.
View 7 Replies
View Related
Jun 14, 2007
Hi Everyone,
Could anyone tell me how I sort a field so it sorts by the surname, not the first name? It's one field with 2 names seperated by a space, i.e. George Michael.
Many thanks for any help.
Essex
View 5 Replies
View Related
Jan 1, 2008
I am doing a database containing names, dates of birth, dates of death etc of my ancestors. Does anyone know the best way of displaying it so I can sort them out by age of death? For example, I want to see someone for example who died aged 70 years and 6 months to be a place above someone who died aged 70 years and 4 months.
View 1 Replies
View Related
Jun 26, 2007
In Quebec there are a lot of place names beginning with "Saint-" or "Sainte-".
When I do an ascending sort on the table itself, these type of names don't seem to follow the expected pattern.
For the names Sainte-Marthe, Sainte-Thérèse, Saint-Ephrem, Saint-Eulalie I should see this order:
Saint-Ephrem, Saint-Eulalie, Sainte-Marthe, Sainte-Thérèse.
Instead, I get Sainte-Marthe, Saint-Ephrem, Sainte-Thérèse, Saint-Eulalie.
The names are spelled exactly as I have them in the table with hyphens and diacritic marks.
Any ideas why there seems to be a problem sorting "Saint-" from "Sainte-?
View 8 Replies
View Related
Jan 10, 2007
Yet another question! When I run the report, it gives me the results in alphabetical order (i.e. April August, etc) instead of monthly order... Is there a way to fix this?
Thanks!
Michele
View 5 Replies
View Related
Jul 26, 2007
I have a field with addresses (numbers and letters) Whenever I try to sort it sorts by the number. How do I get it to only sort by the letters but still include the numbers in the result?
View 1 Replies
View Related
Oct 4, 2005
I have been trying to solve this Access problem for a couple of weeks. I have 2 Access 2002 files where I import info from a Paradox DB. I have been doing this for 12 years. I just bought a new laptop and transferred the programs over (I didn't reinstall because I don't have a floppy drive). Paradox files have a default of an International sort order.
One of my 2 Access files is now requiring an Ascii sort order. The Paradox forum says that something in the Access file is asking for the Ascii sort sequence. I have to keep bouncing back and forth in the Regedit changing the sort order from International to Ascii and back again to use the 2 files.
Do you know how I can make the 1 Access file ask for the International sort order?
View 4 Replies
View Related
Jan 11, 2006
I have a table with an alphanumeric field I want to sort on. If I sort the usual ascending way, data that is numeric is sorted before data that is alpha.
Is there a way to have the alpha data sorted ascending come out ahead of the numeric data srted ascending?
Ex:
Currently,
1
2
3
A
B
c
Desired:
A
B
C
1
2
3
Thanks in advance to all who reply!!!
View 3 Replies
View Related
Jan 25, 2006
i have a simple datsbase with 2 fields - drawing number and description.
the drawing numbers are in the formatt STD123 e.t.c.
When I try to sort numerically the order ends up as
STD1
STD10
STD11
STD100
STD101..........
How do I get it to list in true numeric order in report and table view i.e.
STD1
STD2
STD3.......... Please bear in mind that my knowledge of Access is VERY limited. I've tried a search and don't understand about queries and such like. Even so I'd have thought that even the most basic database programmes would be able to handle something as simple as an alpha/numeric sort list....seems not!!!!!
????????????????
View 8 Replies
View Related