INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Grouping Addresses

Grouping Addresses

(OP)
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

RE: Grouping Addresses

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.

RE: Grouping Addresses

(OP)
Thanks so much for your reply! :)

I will give this a go!

Thank you,

Kind regards

Triacona

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close