Sorting Further From A Duplicates Query

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 Replies


ADVERTISEMENT

Sorting A Table, Apply The Sorting To A Form

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

Find Duplicates And Create Table With Dates Of Duplicates

Feb 12, 2008

Hi this is my first post... so hi all :)

ok what i have is a table with contact details 900k plus

there are about 90k of which are duplicates.

this is the basic feilds that are important in this case.

Id, data_source, data_recived, data_code,

what i want is to have a table with unique records (no dups in data_code)

this table will look like this...

Id, data_code, Num_dups, dup1_source, dup1_date, daysbtw_Dup1_dup2, dup2_source, dup2_date, daysbtw_Dup2_dup3 ,dup3_source, dup3_date, daysbtw_Dup3_dup4 ,dup4_source, dup4_date,

I know there is no more than 4 dups of each record.

what i want from this is a table that will give me a record of how many dups for each record then all the dates that they were added and the date between each record entry.

if anyone can help it would be great .

thanks in advance.

View 6 Replies View Related

Help With Sorting A Query?

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

Sorting In A Query

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

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 1 Replies View Related

Sorting Crosstab Query

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

Sorting Records In A Query

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

Sorting Query Results

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

Sorting Subset Within A Query

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

Find Duplicates Different Than Duplicates Deleted

Dec 8, 2005

Hey, all! Thanks for helping, here is my situation.

I have a table with about 70,000 records that have duplicate Address field values. The rest of the field values for those records are different. When I do a find duplicate querry I get the result that 17,000 records have the same address. However, when I do the append qurrey as instructed here: http://support.microsoft.com/?kbid=209183 I get a total of only 600 records in the new table. I have tried deleting all of the indexes for both the new and old table, with no luck.

I'm using Access 2000 on XP Pro.

If anyone could help with this I would greatly appreciate it!

Thanks

Will

View 14 Replies View Related

Query Help, Duplicates

Aug 23, 2005

I have a table in a healthcare patient database that stores Admitting Number, Scan Number, Last Name, and some other fields detailing the scan. Each patient can have multiple scans and I'm trying to design a query that lists how many scans each patient has had by finding all the duplicate admitting numbers. I'm using this SQL statement:

SELECT MultScans.Admitting_Number, Count(MultScans.Admitting_Number) AS Num_Of_Scans
FROM MultScans
GROUP BY MultScans.Admitting_Number
HAVING (((Count(MultScans.Admitting_Number))>1));

which works fine but I can't figure out how to also print out the last name, scan number and the other fields in this query. If I add the field to the select part it says I can't because the expression is not part of the aggregate function and if I add the expression to the 'group by' the query runs but displays all the duplicates. Thanks for any help.

View 3 Replies View Related

Please Help With This Query On Duplicates

Apr 4, 2006

Please help. I am having difficulty understanding why a subform is showing duplicates despite using SELECT DISTINCT for its query. I have looked all over the forum but am still quite confused.

I think my database is normalised but this may be the problem and can attach it if necessary.

My query is as follows

SELECT DISTINCT StudentAndCourse.ClassID, StudentAndCourse.LevelID, StudentAndCourse.StudentID
FROM [Level] INNER JOIN (Class INNER JOIN StudentAndCourse ON Class.ClassID=StudentAndCourse.ClassID) ON Level.LevelID=StudentAndCourse.LevelID;


Any help would be most appreciated as I cannot understand what is going wrong.

View 1 Replies View Related

Query Without Duplicates

May 1, 2007

Hello,
I am just wondering whether there is any way I could run a simple query that would pull all the data I need and inform me of the duplicates if there is any.

Thanks!

View 2 Replies View Related

Duplicates In Query

Mar 25, 2008

Hi everyone.

I have a query linking 2 tables. The idea of the query was to show our longest serving customers. The one table contains CustNo, Address details, etc and the second table contains AccNo, CurrBal, AccType, CustNo, etc etc. (note the bold fields are the primary keys). However this is bringing back results on account level rather than customer level, i.e CustNo 3 might Have AccNo xxxxxx, AccNo xxxxx1, AccNo xxxxxx2. How do I get it to show the 'oldest' account for each customer. So it will only show each customer once and that customers oldest account. Heres the SQL for the query. Hope someone can help. Thanks

SELECT DBSINV97.DateOpen, DBSINV97.AccNo, DBSINV97.CustNo, DBSINV97.PostalName, DBSINV97.CurBal, DBSINV97.AccType, DBSINV97.DateClose, DBSCUS01A.Title, DBSCUS01A.Initial, DBSCUS01A.Surname, DBSCUS01A.Street, DBSCUS01A.District, DBSCUS01A.Town, DBSCUS01A.County, DBSCUS01A.Postcode

FROM DBSINV97 INNER JOIN DBSCUS01A ON DBSINV97.CustNo = DBSCUS01A.CustNo

WHERE (((DBSINV97.DateOpen)<"2002-01-01") AND ((DBSINV97.DateClose)="1800-01-01"));

View 1 Replies View Related

Duplicates In Query

Mar 26, 2008

I've been researching and reading about how to eliminate duplicates in my Query, but all the suggestions don't seem to work. Here is my problem:

I want to create a Query with information from 2 Tables. Ultimately, I want my Query to be a malining list that I will be sending requests to. But, I want only the names, addesses, etc. of the people who fit certain criteria (info. stored in several different fields of the two tables). So, if a person matches two of my specified criteria, they appear twice in my query. Or if they fit all the criteria, they might appear 5 or 6 times. I want each name and address to show up once, even though the person may fit into several criteria. Does this makes sense?

I've tried typing "DISTINCT" after "SELECT" in SQL, but that didn't do anything. I've also tried changing the "Unique Values" to YES, but that didn't work either.

Sorry if it's unclear, but I am very new to Access! :(

View 7 Replies View Related

Duplicates Query

Nov 24, 2004

Hello
I've created a query that finds duplicate records in a table. I've also made a form based on that query that shows some fields of the duplicate recoeds found. In that form there's also a textbox that counts the records found (using the count([field]) function). Everything works perfectly when there are duplicate records. However, when there are no duplicates , I'd like the textbox value to be 0 (it shows nothing now obviously because the query returns no records), as long as some other actions to be performed. How can I check (in the vb code or somehow else) if the query returns no records as a result ? Thanks in advance

View 3 Replies View Related

Duplicates Query

Jan 9, 2006

Friends,

I have a table with 3 fields:

NAME
AMOUNT1
AMOUNT2

Field AMOUNT1 and AMOUNT 2 can have the same data and I need to run a query which will return records with similar data in both fields. Both fields are text (5 characters) and the match has to be done on the first four characters.

Please note that I have tried with a Find Duplicates query but does not seem to return all the records with showing the same data probably to the fact the the last character is different.

Any help? Thank you.

View 3 Replies View Related

Sorting Query By Date & Employee Name

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

Queries :: Sorting A Field Within A Query?

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

Queries :: Sorting A Query In Unconventional Way?

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

Removing Duplicates From A Query

Aug 14, 2006

I am running a query to return records from a table. I want to eliminate records from the query if the values contained in one field are duplicated. I have tried using the DISTINCT keyword but it only works if the entire record is unique or if I was retieving just one field

Any suggestions appreciated

View 1 Replies View Related

Duplicates In Table/Query

Aug 1, 2007

I am using a combo box to assign gun numbers on an employee form (frmemployees). I also have a query listing only the gun numbers that have been assigned. When I select a gun from my combo box, I what to evaluate if it is already on the gun assignment query. That way I cannot assign the same gun to two different people. I am using the before_update event to do this. The code that I am using is as follows:

Private Sub intgunNumber_BeforeUpdate(Cancel As Integer)

If DLookup([intgunNumber], "qrygunassignmentcurrent", Me.intgunNumber) = Me.intgunNumber Then
MsgBox "Item # is already listed.", vbOK, "DUPLICATE FOUND"
Cancel = True
End If

"me" represents my frmemployees form. The problem is that it's causing an event even for the numbers that aren't listed on the query. I am trying to get the evaluation correct but am having difficulties. All the fields are numeric fields. :( :mad:

View 6 Replies View Related

Query Creating Duplicates

Nov 25, 2005

I have the following two querys which are supposed to return only the latest Note for a Prospect.

QRYNotes
SELECT TBLNotes.ProspectID AS Expr1, Max(TBLNotes.NoteDate) AS MaxOfNoteDate
FROM TBLNotes
GROUP BY TBLNotes.ProspectID;

QRYNotes2
SELECT DISTINCT TBLProspects.CompanyName, TBLNotes.NoteID, TBLNotes.Note, TBLNotes.NoteDate
FROM (TBLProspects INNER JOIN TBLNotes ON TBLProspects.ProspectID=TBLNotes.ProspectID) INNER JOIN QRYNotes ON TBLNotes.NoteDate=QRYNotes.MaxOfNoteDate;

When I run the QRYNotes2, I get more than one record per Prospect instead of just the newest NoteDate.

What is wrong?

View 3 Replies View Related

Hide Duplicates Within Query

Jul 31, 2006

Hi All.
I have a db, with, amongst others, one form that I enter job details, and another form that I enter the materials for the job. These forms are linked by the ID_Number. This all works fine

I have a query that links both these forms together, so when the query is run, it shows the ID_Number of all jobs that have been done completed between dates, whether they have materials assigned to them or not.

This all works fine, but if for example, there are 10 jobs in one month and one of those jobs have more than one material booked against them, then that job number will show twice.
What I would like to do is "Hide Duplicates" on the query.


Can someone help?

Many thanks.

Frank.

View 1 Replies View Related

Query To Show Non-duplicates

Apr 4, 2007

I have a query that includes the following fields

Year
EventNumber
CorrectiveActionNumber
ResponsibleGroup
Committment

Each event will have multiple corrective actions. For each corrective action assigned to a group, the "committment" is also assigned to them, but I also have to assigned a committment to our group (SRG). So this makes the query results show two records for each corrective action, one with the group assigned committment and one for my groups committment. I need a query that will show corrective actions that have the group committment assigned but not a corresponding SRG committment assigned. However since my query results in two separate records, I am unsure how to do this.

Any suggestions?

Thanks,
Jim

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved