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

Group Formula

Status
Not open for further replies.

CNeeds

Programmer
Mar 24, 2004
111
US
I have 4 different fields that need to be in the same group and be search A-Z and be combined if they duplicate.

Sample:
Employee1 - Chris $3.00
Employee2 - Amy $5.00
Employee3 - Chris $2.00
Employee4 - Jack $1.00

I need via Grouping:
Chris $5.00
Amy $5.00
Jack $1.00
 
Are these really four different fields or four instances of the same employee field? I'm assuming these are two different fields, {table.employee} and {table.amt}. Is that correct?

-LB
 
Yes they are 4 different fields, put with same data information but the need to be group as one on the report I'm building.
 
Please provide a little more info--The amount is in a separate field, yes?

-LB
 
Well, you need to get these all in the same two fields, so I would use a command as your datasource and enter something like:

select table.employee1, table.cost1
from table
union all
select table.employee2, table.cost2
from table
union all
select table.employee3, table.cost3
from table
union all
select table.employee4, table.cost4
from table

Add the punctuation appropriate to your database.

Then you can insert a group on {table.employee1} and insert a sum on {table.cost1} at the group level.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top