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!

Need help with zip code report 1

Status
Not open for further replies.

snowyej

Technical User
Nov 26, 2001
69
0
0
US
I am pretty new to Crystal Reports so this may have a simple answer.

I am running a zip code report for all patients in a clinic I work for. They want a count of the number of patients in each zip code found in the database. I have the report that lists out the zip codes and gives a count for each. However, some zip codes are just 5 digits while others have "5-4" or even the full 9 digits without the dash. So I could potentially show:

97681 (total: 500)
97681-1234 (total: 1)
976812345 (total: 1)

Instead of it listing that way, I'd rather it just show:

97681 (total: 502)

Is there a way to tell it that I only want to view the first 5 numbers of the zip code and to strip everything else off of the end...and then group them and show me the counts? Does that make sense?

Oh, and I'm on Crystal 8.5.

Thanks!
Elizabeth :)
 
Create a formula of:

LEFT(TRIM({TABLE.FIELD}),5)

Use that to group and use conventional summaries of right clicking a field in the details and selecting Insert->Summary->Count and select at the group level.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top