Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grouping Addresses

Status
Not open for further replies.

Triacona

Technical User
Jun 11, 2009
462
0
0
GB
Hi all,

Thanks for a great forum.

Please could you help me with the following:

I have a query that outputs a list of addresses.
The addresses are grouped like so:
Addr
1 Albert Drive, Sheerwater, Woking, Surrey, GU21 5JZ
1 Bateson Way, Sheerwater, Woking, Surrey, GU21 5LD
1 Bentham Avenue, Sheerwater, Woking, Surrey, GU21 5LF
1 Blackmore Crescent, Sheerwater, Woking, Surrey, GU21 5NP
1 Broadwater Close, Woodham, Woking, Surrey, GU21 5TW
1 Bunyard Drive, Sheerwater, Woking, Surrey, GU21 5NU
1 Dartmouth Avenue, Sheerwater, Woking, Surrey, GU21 5PD
1 Dartmouth Green, Sheerwater, Woking, Surrey, GU21 5PW
10 Albert Drive, Sheerwater, Woking, Surrey, GU21 5QZ
10 Bateson Way, Sheerwater, Woking, Surrey, GU21 5LD
10 Bentham Avenue, Sheerwater, Woking, Surrey, GU21 5LF
10 Blackmore Crescent, Sheerwater, Woking, Surrey, GU21 5NP
10 Broadwater Close, Woodham, Woking, Surrey, GU21 5TW
10 Bunyard Drive, Sheerwater, Woking, Surrey, GU21 5NU
10 Dartmouth Green, Sheerwater, Woking, Surrey, GU21 5PW
10 Devonshire Avenue, Sheerwater, Woking, Surrey, GU21 5QN

As you can see the query is grouping it via number.
What I want is for it to group by street names.

I have tried to group this in a report using the first 15 characters and this does not work.
Is there any way I can only group via the street.

Just for information, there are more addresses (2800) and some have names, rather than numbers.

Thanks for all your forthcoming help [smile]

Thank you,

Kind regards

Triacona
 
If you want to group everything up to the first comma. I would build a function.

Code:
Public function getStreet(address as variant) as string
  dim addParts() as string
  if not isnull(getStreet) then
    addParts = split(address,",")
    getStreet = trim(addParts(0))
  end if
end function

Untested, but that should return the everything up to the comma
"1 Albert Drive"
Then you can group on that.
 
Thanks so much for your reply! :)

I will give this a go!

Thank you,

Kind regards

Triacona
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top