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!

Group a Formulated Field 1

Status
Not open for further replies.

brecat77

IS-IT--Management
Feb 27, 2008
28
US
I have a field that has 8 numeric characters in it. I use a formula to remove the last four. I need to group those first four onto one line with the sum of all with those first four.

As an example you have

42000000 $10
42000001 $20
42000002 $30
42010000 $10
42010001 $20
42010002 $30

i am using this formulas to remove the last four

Left ({table.field}, 4)

i want on one row

4200 $60
4201 $60

and so on
 
Your formula will RETURN the first 4, not remove the last 4.

Is this data:

42000000 $10

Actually one field in the database, or 2?


Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
You should be able to do it as
Code:
Left ({table.field}, 2) & Right({table.field}, 5)
That's based on your data sample. There is also MID, and SPLIT for more complex cases.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
it is 2 fields, i need the information consolidated into one row using the first 4 digits and the amounts of each field summed into one line also
 
So create a formula that will take the first 4 characters:
LEFT({table.field})
Then group the records by this formula.
Insert a summary for the amount field with results in each group footer.
Place also the group name in the group footer.
Suppress the Details section.

-------------------------------------------------------------------------------------------------------------------------
"Now I can look at you in peace; I don't eat you any more." Franz Kafka, while admiring fish in an aquarium
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top