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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Database Query Grouping Question 1

Status
Not open for further replies.

snowyej

Technical User
Nov 26, 2001
69
0
0
US
I hope this is the right forum for this question..

I am creating a pivot table report from data in a SQL database. The report is to show the count of patients in each zip code that all of our doctors have seen this year. So it should look something like this:

Jones Brown Green Smith
98765 123 99 83 150
92837 38 102 11 203
98039 87 87 29 111
Totals:

My problem is that we have some zip codes that have the last four digits included and I'd like to group all of those together. Currently it's showing something like:

98727
98765
98765-1234
98765-2345
987653456
98799
etc.

Is there a way I can group ones that have the same first 5 digits together so it shows a total count rather than have it show each on a separate line?

Hope this make sense. If i need to clarify anything, let me know.

Thanks in advance!

Elizabeth :)
 



Hi,

Make another column for
[tt]
=Left(YourCellRef,5)
[/tt]
with an appropriate heading, and group on that column instead.

Skip,
[sub]
[glasses] [red][/red]
[tongue][/sub]
 
Perfect! That worked great. Thank you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top