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

Custom Group by First Letter 1

Status
Not open for further replies.

Oglesbay

Instructor
May 5, 2006
71
US
Hi all. I have a report with about 2,000 names grouped alphabetically. What I would like to do though is have a group heading of just the first letter. For example:

A
Adams, John
Ashley, Jennifer
B
Breckenworth, Steve
Busby, Mary
C
Christy, Stephen
Crosby, Bill

Does any one have a quick way of doing this? It seems easy but I can't get it figured out. Thanks!
 
Create a formula of:

left(trim({table.field}),1)

Now group on that formula.

-k
 
Create a formula:
{LastNameField}[1]

Use this formula for the grouping.
 
Thanks guys, but when I typed in what said, it came up with an error. What I did was I went to the Group Expert and chose to sort by "xlastname". When I went to the options, I chose to :Use a Formula as a Group Sort Order" and put in the following formula:

left(trim({person.xlastname}),1))

I got the error:

A constant expression is required here (And the field was highlighted.)

Any ideas?
 
So instead create a formula.

View->Field Explorer

Right click formulas and select new and name it

Then use my code.

The problem with samiam is if there's an inadvertent space in there, it will show the space, I trimmed the field.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top