Showing posts with label dept. Show all posts
Showing posts with label dept. Show all posts

Wednesday, March 21, 2012

Group Totals on Last page - How?

I have a report that groups by dept #, job code and earnings code.

9999 Administration

033 Secretary

200 Regular Pay 44.00 1000.00

300 Sick Pay 8.00 25.00

400 Overtime 3.00 75.00

8888 Janoitorial

055 Janitor

200 Regular Pay 24.00 800.00

300 Sick Pay 4.00 15.00

400 Overtime 1.00 45.00

On the last page of my report I want to sum the earnings totals by earnings number. For Example:

Totals

200 Regular Pay 68.00 1800.00

300 Sick Pay 12.00 40.00

400 Overtime 4.00 120.00

Can this be done?

Create a new table at the bottom of the report, group by earnings code, and sum the numbers.|||

Hi Jim,

another way to do this, is to use the table footer for the sums.

In the table footer, put the following expression

=Sum(IIF(Fields!earnings_code.value = 200, Fields!totals, cint(0))) this should be for regular pay and just replace the earning code for
the rest.

Then select the table, go to the properties, and there is an option called "Print footer rows on last page" and check that.

That should do it, hope that helps!

Bernard

|||Thanks for the help. I really appreciate it|||

Can you mark the answers that were helpful?

Thanks.

Sunday, February 26, 2012

group by and having cluase problem

dear sir/madam
I have given a table
name, dept, sal, doj
n1, d1, 1000, 1/2/2001
n2, d2, 2000, 2/3/2005
n3, d3, 3000, 3/2/2002
n4, d4, 4000, 4/7/2003
n5, d5, 5000,12/5/2006
n6, d2, 6000,3/2/2005
I have to select dept wise record doj should not be in group by but
all record should be doj > 1/2/200. My main problem is that if I dont
take doj in group by then how can I select record on condition of doj.
Please Help me
Thanks in Advance
If you need to filter all rows by the condition doj > 1/2/2001 you can add
this filter to the WHERE clause:
WHERE doj > '20010102'
HTH,
Plamen Ratchev
http://www.SQLStudio.com
|||Hi
Can you explain what are you trying to achive better?
create table #t (name char(2),dept char(2),sal int,doj datetime)
go
insert into #t values ('n1','d1',1000,'20010201')
insert into #t values ('n2','d2',2000,'20050302')
insert into #t values ('n3','d3',3000,'20020203')
insert into #t values ('n4','d4',4000,'20030704')
insert into #t values ('n5','d5',5000,'20060512')
insert into #t values ('n6','d6',6000,'20050203')
select * from #t where doj=....
Please post desired result
<vinodkus@.gmail.com> wrote in message
news:25c5cfc8-e9d9-4c05-9538-235ac482adf2@.e23g2000prf.googlegroups.com...
> dear sir/madam
> I have given a table
> name, dept, sal, doj
> n1, d1, 1000, 1/2/2001
> n2, d2, 2000, 2/3/2005
> n3, d3, 3000, 3/2/2002
> n4, d4, 4000, 4/7/2003
> n5, d5, 5000,12/5/2006
> n6, d2, 6000,3/2/2005
> I have to select dept wise record doj should not be in group by but
> all record should be doj > 1/2/200. My main problem is that if I dont
> take doj in group by then how can I select record on condition of doj.
> Please Help me
> Thanks in Advance

group by and having cluase problem

dear sir/madam
I have given a table
name, dept, sal, doj
n1, d1, 1000, 1/2/2001
n2, d2, 2000, 2/3/2005
n3, d3, 3000, 3/2/2002
n4, d4, 4000, 4/7/2003
n5, d5, 5000,12/5/2006
n6, d2, 6000,3/2/2005
I have to select dept wise record doj should not be in group by but
all record should be doj > 1/2/200. My main problem is that if I dont
take doj in group by then how can I select record on condition of doj.
Please Help me
Thanks in AdvanceIf you need to filter all rows by the condition doj > 1/2/2001 you can add
this filter to the WHERE clause:
WHERE doj > '20010102'
HTH,
Plamen Ratchev
http://www.SQLStudio.com|||Hi
Can you explain what are you trying to achive better?
create table #t (name char(2),dept char(2),sal int,doj datetime)
go
insert into #t values ('n1','d1',1000,'20010201')
insert into #t values ('n2','d2',2000,'20050302')
insert into #t values ('n3','d3',3000,'20020203')
insert into #t values ('n4','d4',4000,'20030704')
insert into #t values ('n5','d5',5000,'20060512')
insert into #t values ('n6','d6',6000,'20050203')
select * from #t where doj=....
Please post desired result
<vinodkus@.gmail.com> wrote in message
news:25c5cfc8-e9d9-4c05-9538-235ac482adf2@.e23g2000prf.googlegroups.com...
> dear sir/madam
> I have given a table
> name, dept, sal, doj
> n1, d1, 1000, 1/2/2001
> n2, d2, 2000, 2/3/2005
> n3, d3, 3000, 3/2/2002
> n4, d4, 4000, 4/7/2003
> n5, d5, 5000,12/5/2006
> n6, d2, 6000,3/2/2005
> I have to select dept wise record doj should not be in group by but
> all record should be doj > 1/2/200. My main problem is that if I dont
> take doj in group by then how can I select record on condition of doj.
> Please Help me
> Thanks in Advance