How would I indentify duplicate Records ? Eg. Bob has qualification A and B Steve has qualification A and C Dan has qualification c and b Nash has qualification A Employees with duplicate values are Bob and Nash - how do I do this in SQL?
How would I indentify duplicate Records ? Eg. Bob has qualification A and B Steve has qualification A and C Dan has qualification c and b Nash has qualification A Employees with duplicate values are Bob and Nash - how do I do this in SQL?
I'm not entirely sure what you're asking. Could you rephrase, please? -- '(' Jeff A. Stucker \ Business Intelligence www.criadvantage.com --------------------------------------
Jeff: The list below describes employees and the job qualifications: Eg. Bob has qualification A and B Steve has qualification A and C Dan has qualification a Nash has qualification A and B I need a query to identify all those employees that have the same qualification. Using the list above only Bob and Nash have identical qualifications.
It really depends on how your qualifications are stored in the database. This probably is a SQL query question more than a reporting question, but if you post your database structure (tables/columns related to qualifications) we might be able to help you. -- '(' Jeff A. Stucker \ Business Intelligence www.criadvantage.com --------------------------------------
Employee Table: Contains Employee Name, And Employee ID Employee Qualification: Contains Employee ID, and Job ID Job ID: Contains Job ID Employee links to employee qualifications links to jobs
Hmmm.... This will take some thinking. My guess is that it will take a FULL OUTER JOIN of the EmployeeQualification table to itself, and some very judicious WHERE clause manipulation to make sure that everything matches completely on both sides (exclude NULL values). And depending on the logic you use, you may add a NOT EXISTS clause outside the whole thing. I hope that gets you started, or at least considering some options.... Cheers, -- '(' Jeff A. Stucker \ Business Intelligence www.criadvantage.com --------------------------------------
1.Fix Duplicate fields Rather then Duplicate Records?
Hi All, I have a problem... I have duplicate field values that are causing Duplicate Records in a sense. Examples: -------------------------------- CREATE TABLE VTable (vid VarChar(100), vname VarChar(50)) Insert into VTable (vid, vname) Values('1', 'bill') Insert into VTable (vid, vname) Values('2', 'bill') Insert into VTable (vid, vname) Values('3', 'mike') Insert into VTable (vid, vname) Values('4', 'mike') Insert into VTable (vid, vname) Values('5', 'mike') Insert into VTable (vid, vname) Values('6', 'jill') Insert into VTable (vid, vname) Values('7', 'jill') I have eight other tables that link the value of vname by relating the vid field. I need to essentially pick one of the duplicate records(fields) and change the subsequent tables entries where the other ones are present: CREATE TABEL T1(vid VarChar(100)) Insert into VTable (vid) Values('1') Insert into VTable (vid) Values('2') Insert into VTable (vid) Values('1') Insert into VTable (vid) Values('3') Insert into VTable (vid) Values('4') I figured out a way of creating temporary tables and querying and updating the data. My problem with this, as I started working on it, is that I realized that I could not get a distinct record based on vid and vname; because in fact they are all unique records. Any ideas how to resolve this?
2.Updating duplicate records and then deleting one of the duplicates
Hi all... I am having a problem with what I thought should have been quite simple: I have a table: declare @tb_Results table (PeriodSID int ,PeriodStartDate datetime ,PeriodEndDate dateTime ,TotalDaysOff real) I want to find any records that have the three fields PeriodSID ,PeriodStartDate ,PeriodEndDate duplicated. eg:Record 1-->12, 2005-01-01, 2005-12-31 Record 2-->12, 2005-01-01, 2005-12-31 Once we have a duplicate record I would like to update the duplicates with the SUM value of the duplicated TotalDaysOff fields. I would then like to be able to delete all but one of the duplicate records. Any help with this would be greatly appreciated Many thanks Paul
3.TOUGH INSERT: Copy Sale Record/Line Items for "Duplicate" Record
I have a client who needs to copy an existing sale. The problem is the Sale is made up of three tables: Sale, SaleEquipment, SaleParts. Each sale can have multiple pieces of equipment with corresponding parts, or parts without equipment. My problem in copying is when I go to copy the parts, how do I get the NEW sale equipment ids updated correctly on their corresponding parts? I can provide more information if necessary. Thank you!! Maria
4.How to Select First Record when we have duplicate records
Hi All, How to Select the "First Record" from the Table when we have duplicate values. and we dont want to see the duplicate values. Scanario. i have Company and Address Table, Company_id is the foreign key in Address table. one company can multiple addresses. plz guide me how i can select the company first address. Thanx in Advance Tenzeel.
5.duplicate record-...type mismatch
I have a frontend (*.adp) - backend (Sqlserver) application. I made a command button on a form that takes the current record, duplicates it and then displays the new identical record. When I compile the procedure, I haven't errors, but when I click on a command button I get message 'Type mismatch'. I have selected reference MS DAO 3.6. Object Library. What's wrong? Thanks in advance, Marie Private Sub cmd_Duplicate_Click() On Error GoTo Err_cmd_Duplicate_Click Dim Sifr As Long Dim RstDup As Recordset Sifr = Me.ID Set RstDup = Me.RecordsetClone DoCmd.GoToRecord , , acNewRec RstDup.FindFirst "[ID]=" & Sifr If Not RstDup.NoMatch Then Me!ID_nar = RstDup!ID_nar Me!ID_izv = RstDup!ID_izv 'etc. RunCommand acCmdSaveRecord End If RstDup.Close Set RstDup = Nothing Exit_cmd_Duplicate_Click: Exit Sub Err_cmd_Duplicate_Click: MsgBox Err.Description Resume Exit_cmd_Duplicate_Click End Sub -- marie
Users browsing this forum: No registered users and 53 guest