Select with partial group

Hi

I have a clients table on which I want to run a select query on to extract 
all fields. But I also want the result-set to be grouped by Company and 
Postcode to remove any duplicates. The reason I don't want to include other 
fields Address line 1 etc as there could be minor defences in spellings, 
punctuations etc.

How do I go about such a query?

Thanks

Regards 


0
John
10/14/2007 9:50:05 PM
access 16762 articles. 2 followers. Follow

2 Replies
553 Views

Similar Articles

[PageSpeed] 36

iam fine
"John" <John@nospam.infovis.co.uk> wrote in message
news:upGpvwqDIHA.3548@TK2MSFTNGP06.phx.gbl...
> Hi
>
> I have a clients table on which I want to run a select query on to extract
> all fields. But I also want the result-set to be grouped by Company and
> Postcode to remove any duplicates. The reason I don't want to include
other
> fields Address line 1 etc as there could be minor defences in spellings,
> punctuations etc.
>
> How do I go about such a query?
>
> Thanks
>
> Regards
>
>


0
HELENA
10/15/2007 2:45:54 AM
On Sun, 14 Oct 2007 22:50:05 +0100, "John" <John@nospam.infovis.co.uk> wrote:

>Hi
>
>I have a clients table on which I want to run a select query on to extract 
>all fields. But I also want the result-set to be grouped by Company and 
>Postcode to remove any duplicates. The reason I don't want to include other 
>fields Address line 1 etc as there could be minor defences in spellings, 
>punctuations etc.
>
>How do I go about such a query?
>
>Thanks
>
>Regards 
>

Tom's suggestion to do it directly on the report should be fine; if you want
to create a query for display (but not editing, see below) on a form or for
export, use a Totals query. Group By the Company and Postcode, and use the
"First" operator on the address fields to select the first record in disk
storage order (essentially an arbitrary, uncontrolled selection of one of the
addresses).

This query, like all totals queries, will not be updateable. If you want to
update this data you will probably want to normalize it into a table with one
record per company, related one-to-many to a table containing distinct
information. This would be a step on the way to cleaning up the near-duplicate
addresses (though that will require a USB - Using Someone's Brain - interface
to finish).

             John W. Vinson [MVP]
0
John
10/15/2007 8:52:51 PM
Reply:

Similar Artilces:

Run report on multi selected records.
I try to make a report for a custom entity that works like the Account Summary: let's say that it's Customer's Inquiry Summary for entity Customer's Inquiry I made the report so that I'm able to run the report on Customer's Inquiry Form. But when I select multi records in the list of Customer's Inquiry and run report, only one record is show in one page of the the report. I would like to have the selected records appear in the report with each record on each page. How can I do this? ...

Combo box list selection based on earlier selection by user
HI, I have a form that has a combo box 1 (Product) that reads a the Product table and has a unique id attached to each product (RO#). There is a second combo box 2 that is RO#. Now what I would like to do is when a user selects a Product in combo box 1, the system should lookup the Product selected from combo box 1 and upload the corresponding RO# in the combo box 2 list. Now I am using both combo boxes as Unbound and in the combo box 2 I have the two columns Product and RO# - in the Criteria row of RO# I have the following: Like IIf([Forms]![xa_f_lookup]![RO#]=" ",[Forms]![x...

grouping a chart in Access
I have a query that is 31 rows. I created a report that is grouped by Farm Name and House. The data shows correctly on each page for each Farm and House, but when I add a chart it gives me the data on the first page, but then gives me 30 pages of blank charts, till the next group. What did I miss? I am using Access 2010 beta. I expect the issue is with the section of the report containing the chart or the Link Master/Child properties of the chart control. -- Duane Hookom MS Access MVP "dstraub" <dstraub@discussions.microsoft.com> wrote in message new...

Help with grouping columns
Maybe I'm overlooking the obvious...but I'm having a hard time groupin columns. Here's the goal: Columns A - L are the 12 months... Jan-Dec. I want to group 3 columns (3 months) at a time. So I'd have 4 colum groups side by side. I select the entire first 3 columns...data...group/outline...an group...creates the group fine. I then select the next 3 columns (next 3 months)...to be in their ow group. When I try to group them...it just ads them to the firs group...making one large group. The first 3 columns are not selected when I do this. I've also tried playing with the s...

Exmerge options with Recovery Storage Group
I recoverd mailboxes into a Recovery Storage Group. I want to exmerge into a pst rather then the users mailbox. when I run Exmerge from outside the recovery storage group on one of its mailboxes, I get an error in exmerge when getting a list of mailboxes from the recovery group and it says to look in the exmerge.log. that says "it cannot identify the user with the msExchmailboxGuid" and then gives the GUID number. Is this caused by the users mailbox being in the recovery group. Can the exmerge only work with the built in version and going to the users live mailbox? Thanks in advance...

Recovery Storage Group error when trying to add database
Running Exchange 2003, SP1, native mode on Windows 2003 I have created a recovery storage group, and when I right click on it to add the database to recover, I get the following error: The search filter cannot be recognized. Facility: Win32 ID no: 8007203e Exchange System Manager I have verified that AD has synced. Any ideas? Hi, The problem is that in the distinguished name of the database there is a single parenthesis without its match. Examples of this would include: cn=Mailbox Store 1 (SG1,cn=First Storage Group,.... cn=Mailbox Store 1 (SG2),cn=Second Storage Group (TestServer,cn...

Can't select objects in Excel 2007
I'm trying to create a form in Excel 2007, and although I can manipulate, copy & paste controls (check boxes, etc) I can't select multiple objects to align them, etc. I've checked on-line help (and have followed the instructions), and other websites, but no one seems to have indicated a problem. It is extremely cumbersome and I need a solution. Any ideas? Thanks in advance, Jim Berglund I know this is about a year too late, but it may help others who have stumbled across this page looking for similar help. On the Home tab, in the Editing group, click Find & Select....

Legal archiving for a group of users
I have a situation for legal reasons that i have to archive all communications for a group of users. I need to know how I can setup an Archive with either creating a seperate storage group for the users or installing some 3rd party solution. I've just never had a situation like this and need to know what my options are for doing such a task. Thanks in advance for anyone that might respond In article <00b801c3c006$571470c0$a301280a@phx.gbl>, "Linnie Gooch" <linniegooch@hotmail.com> wrote: > I have a situation for legal reasons that i have to > archive a...

Lot Selection not Showing when I select PO on Receiving Entry
Usually, the Lot selection screen would pop up when I select a PO at the Line Detail of the Receivings Entry, now it does not! And GP will let items post without a lot number! It seems as if a setting has changed. Any ideas anyone? Any help is appreciated. Thanks, R Are you sure the item is marked to track lots? This wiould be set item by item on the Item Maintenance Options window. -- Richard L. Whaley Author / Consultant / MVP 2006-2008 Documentation for Software Users Get our Free Tips and Tricks Newsletter and check out our books at http://www.AccoladePublications.com &q...

Select contact then hangs
Hi, please help. I have a user that when she selects a contact using To: in a new email, after selecting 2, it closes outlook??. Spec is W2kSP4\office2k with all windows updates and office updates installed. Profile has been deleted and re-created, plus i have set up personal folders and moved contacts into there, and set that folder as a default, but makes no difference. Please help. ...

Add users to a Distribution Group using csv file
Is it possible? I have a list of approx 3200 users that I want to add to a common duistribution group w/o having to do it manually. At present I have a csv file with all the users that I want to be in the group. Is there a way to import them into the group using this file w/o recreating their accounts using csvde or ldife? TIA. Should be http://support.microsoft.com/?kbid=237677 http://www.computerperformance.co.uk/Logon/Logon_CSVDE_Bulk.htm Nue "kage13" <kage13@discussions.microsoft.com> wrote in message news:F8FB3846-DCDE-473F-9F1D-89E8CF0A66E3@microsoft.com... &...

Selecting rows from various sheets
Hi all, I have several sheets with a few columns in each. One colum in each sheet has a unique value. Most of these unique values are th same in each sheet but not all. Is there any way that I can set up new sheet that will have the unique value in column 1 and th corresponding column values frommeach sheet beside it. For example Sheet 1 aa 1 1 1 bb 2 2 2 cc 3 3 3 Sheet 2 aa 4 4 cc 5 5 Result aa 1 1 1 4 4 bb 2 2 2 cc 3 3 3 5 5 Thanks alot, Sha -- sha ----------------------------------------------------------------------- shav's Profile: http...

select text in Calendar
I'm working on a calendar in Publisher. I'm adding text into a cell by spacing down 1 point, then typing in 8 points. Doing fine until April. At that time, I can only select cells (whole days). It will not let me select the text. Help is no help. Any hints out there. Did I accidentally select something to do this? Bonnie Have you added a picture to the cell or a shape? If you have send it to the back, make the cell no fill and try again. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "GoBonnieGo" <GoB...

How to move Ex2k3 Sp1 between Admin Groups
All my Exchange 2003 servers have Sp1 applied. (we are still in Mixed Mode). How do I move a Exchange "003 server from an admin group with only itself and an Exchange 5.5 server init to another admin group with both Exchange 2003 & 5.5 servers in it ? 1) How do you actually do it ? 2) Should I remove the Exchange 5.5 Server first or remove it after the move ? Thank's Godfrey You cannot move servers between admin groups. You can move users between admin groups, though if: a) You're in Exchange native mode or b) You use the site consolidation tools in Exchange 2003 SP1...

macro to filter data based on selected data
Hi, I am looking for a macro that requests input of a reference code and then a date and then filters the data in my spreadsheet based on this criteria. I am using excel 2007. Any help with this will be greatly appreciated. You can probably record a macro while doing it manually and then clean it up and add input boxes to ask the question or input your variable in a cell and use that. If all else fails, If desired, send your file to my address below. I will only look if: 1. You send a copy of this message on an inserted sheet 2. You give me the newsgroup and the ...

Link select with a blast
I have Win 7 Home Premium, x64. Quite often, when I select a link, a mouse pointer changes to a palm with a blast. I understand, the palm is the standard mouse pointer for link select, but what is the blast? What it indicates? -- Ilya Zeldes Fort Myers, Florida Hi Ilya, I suspect that this is being caused by a tracking program. Run something like Ad-Aware and see if it indicates a tracking company. If so, you can delete it, however, it might prevent you from accessing that particular website. Dave "Ilya Zeldes" wrote in message news:7A6FF9B1-5512-44...

Can I send a message from a distribution group
One of our users belongs to a distribution group, and is trying to SEND a message using the Group address as the sender. Is this possible or does the sender address have to have a mailbox associated with it and not just an address (mailbox enabled rather than just mail enabled)? Thanks for your help "Midwest Muskie" <MidwestMuskie@discussions.microsoft.com> wrote in message news:85D00313-EC00-4266-9B54-7196B0C50D4D@microsoft.com... > One of our users belongs to a distribution group, and is trying to SEND a > message using the Group address as the sender. Is this ...

Count Number of Subgroups in Group Header
I have a report with two groups and a detail section. The groups are Location and Person and the detail lists services. I already have a count of each service per person and each service per location. What I need is a count of each person per location. I've done this in the Location footer with no problem, but I need to show it in the Location header instead. I have a text box with a control of =1 that sums over the group in the Person group header. I just refer to that text box in my location footer and all is good. But when I try to refer to that same text box from m...

Select Case in a Change Event
Hi, I am trying to use a worksheet Change Event to trap changes to specific columns. depending on which column is chnaged by the user, the value in another ciolumn will be altered; so, changes in either column O or P will update column Q, changes in either column T or U will update column V and changes in column Z or AA will update column AB. What I can't figure out is the Select Case bit (where I've got the shouted question below). Here's what I've put together, any comments would be much appreciated. Private Sub Worksheet_Change(ByVal Target As Range) ...

Select Records based another table...
This may be very elementary, but i can't wrap my brain around it. I have tried to dummy it down as much as i can for myself, with plans of adapting it into something working. I have three tables that look like the following: Tbl 1: ProdID A B C 1 $1 $2 $3 2 $4 $5 $6 3 $7 $8 $9 Tbl 2: RmNum ProdID 1 3 1 2 2 1 2 2 Tbl 3: RmNum Style 1 A 2 C Relationships are: [tbl1 ProdID] ------ [tbl2 ProdID] [tbl2 RmNum] ...

Multi-Select List Box Does Not Retain Selected Items
I created an Outlook Form in 2003. But when I select items in the list box they do not remain select when I select another control on the form. Any suggestions? Did you bind the list box to a keywords field? -- Sue Mosher, Outlook MVP Author of Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "kaykay" <anonymous@discussions.microsoft.com> wrote in message news:276dd01c4638d$bd5af590$a501280a@phx.gbl... > I created an Outlook Form in 2003. But when I select > items i...

Void partially applied credit notes in payables
In the payables module if you have the following scenario, you cannot void the credit note: Invoice $100 Credit note $300 - applied to above invoice Invoice moved to history automatically as it has a zero remaining balance. Credit note remains open with an unapplied balance of $200. If you try to void through Transactions --> Purchasing --> Void open documents you get an error message to say it is partially applied so cannot be voided. You cannot unapply the transaction. The only workaround is to process an invoice for $200, apply the remaining balance of the credit note and then...

Calendar and Folder Sharing Using Groups
We are running Exchange 2000 in mixed mode and are trying to share calendars and folders using group permissions. In order to assign group permissions do these groups need to be global security groups? When we try to give permissions to a universal distribution group, using Outlook 2002 SP2, we get an error message "The modified permissions could not be saved. The client operation failed." I believe you'll need to be in native mode to do this. Note, however, that this would be best posted in m.p.exchange.admin as it isn't an Outlook issue. Jeff Martin wrote: > We are ...

Restoring Exchange 2003 Information store to recovery storage group
Hi, Im trying to restore an exchange information store to a recovery storage group without success. When trying to do so i get a few errors. We have an Exchange 2003 server, and using Veritas Netbackup to restore the stores. The first problem is when actually performing the restore i get an error as below; 14:22:02 (15226.001) TAR - Microsoft Information Store:\SG3\Log files_1112513459 14:22:02 (15226.001) MNR - The file was renamed to the following: 14:22:02 (15226.001) UTF - e:\temp 14:22:02 (15226.001) (15226.001) WRN - error writing file: e:\temp 14:22:03 (15226.001) (15226.001) WRN -...

VBA
I am very new to VBA and access and have a question regarding a SELECT statement. I am going to run a select (recordset - so I can loop through and process each record) but on my SELECT I want to make sure I return at least 20 rows, otherwise I am going to change my WHERE clause to include more rows. Is there an easy way to do this or do I need to just do an inital SELECT COUNT(*) and then decide which WHERE clause to use?? Do you have an example I can look at? Thank you in advance! AJ On Fri, 14 Dec 2007 17:14:00 -0800, AJ <AJ@discussions.microsoft.com> wrote: I would not first ...