Need help writing expression

L

Laura

I need to write an expression that will use
the "HoursWorked" field. If the HoursWorked are 32 or
less then I would like the hours to be multiplied by 12.
If the Hours Worked are over 32, then 32 hours should be
calculated by 12 and the hours over 32 should be put in a
new field called Carryover. Hours are entered through
timesheets and the report I'm creating adds the total
hours for a specified time period, i.e.,
=sum([hoursworked]).

How would I create a second calculated field to store
the carryover number? And is this the right thing to do?
The way this report works, is that people work hours each
month, and can only be credited for 32 hours per month.
So any hours over 32 in that month need to go into
carryover. And if on a future month they work less than
32 hours and have some time in carryover, then the
carryover should be used (up to a maximum of 32 hours of
carryover and actual hours for the month).

Please share any ideas you may have, thank you!

Laura.
 
D

Dan Artuso

Hi Laura
I'm afraid you'll have to supply more info.

John has attempted to give you an answer on how to
create the calculated field within a query.
That's what this is:
Carryover: IIF([Hours Worked] > 32, [Hours Worked] - 32, 0)


What is the Record Source for the report? Is it a query?
Are you showing everyone's hours or a single person's?
 
L

Laura

I need to write an expression for a report that will use
the "HoursWorked" field. If the HoursWorked are equal or
less than 32, then I would like the hours to be
multiplied by 12. If the Hours Worked are over 32, then
32 hours should be calculated by 12 and the hours over 32
should be put in a new field called Carryover. Hours are
entered through timesheet forms and the report I'm
creating adds the total hours for a specified time
period, i.e., =sum([hoursworked]). The record source is
a query that brings up three fields: townhome number,
hours worked and dates. The criteria for date is "Between
[enter state date] and [enter end date]. The report
prints one page per townhome. The =sum([hoursworked])
section adds up the hours worked for the specified dates.

The way this report works is that people work hours each
month, and can be credited for a maximum of 32 hours per
month. So any hours over 32 in that month need to go
into carryover. And if on a future month they work less
than 32 hours and have some time in carryover, then the
carryover should be used (up to a maximum of 32 hours of
carryover and actual hours for the month).

People are able to get a $12 per hour credit for
community service performed to a maximum of 32 hours per
month and this report is to show the status on the
monetary value of the hours worked during the month, and
also how many carryover hours they have. Any community
service they perform over 32 hours will go into a
carryover field. If they ever go under 32 hours in a
month, then carryover hours should be added to the actual
hours, up to a maximum of 32 hours per month. So the
carryover field will be constantly changing, either being
added to or subtracted from, depending on how many actual
hours are worked monthly.

How would I create a second calculated field to store the
carryover number? And is this the correct way to handle
it?

Any help is much appreciated.
-----Original Message-----
Hi Laura
I'm afraid you'll have to supply more info.

John has attempted to give you an answer on how to
create the calculated field within a query.
That's what this is:
Carryover: IIF([Hours Worked] > 32, [Hours Worked] - 32, 0)


What is the Record Source for the report? Is it a query?
Are you showing everyone's hours or a single person's?

--
HTH
Dan Artuso, Access MVP


I need to write an expression that will use
the "HoursWorked" field. If the HoursWorked are 32 or
less then I would like the hours to be multiplied by 12.
If the Hours Worked are over 32, then 32 hours should be
calculated by 12 and the hours over 32 should be put in a
new field called Carryover. Hours are entered through
timesheets and the report I'm creating adds the total
hours for a specified time period, i.e.,
=sum([hoursworked]).

How would I create a second calculated field to store
the carryover number? And is this the right thing to do?
The way this report works, is that people work hours each
month, and can only be credited for 32 hours per month.
So any hours over 32 in that month need to go into
carryover. And if on a future month they work less than
32 hours and have some time in carryover, then the
carryover should be used (up to a maximum of 32 hours of
carryover and actual hours for the month).

Please share any ideas you may have, thank you!

Laura.


.
 
D

Dan Artuso

Hi,
Okay, can you post the SQL for the query?
The easiest way would be to add the calculated field to that.

What is sum[hoursworked] actually summing?
Each townhome's hours worked?

Your query returns ALL townhome's hours worked?
Are you grouping by anything in your report?

Remember, we can't see your report or the query that feeds it and those
are the important things here.
If we can't solve this in the newsgroup, I'd be willing to take a look at a
copy of your db.

--
HTH
Dan Artuso, Access MVP


Laura said:
I need to write an expression for a report that will use
the "HoursWorked" field. If the HoursWorked are equal or
less than 32, then I would like the hours to be
multiplied by 12. If the Hours Worked are over 32, then
32 hours should be calculated by 12 and the hours over 32
should be put in a new field called Carryover. Hours are
entered through timesheet forms and the report I'm
creating adds the total hours for a specified time
period, i.e., =sum([hoursworked]). The record source is
a query that brings up three fields: townhome number,
hours worked and dates. The criteria for date is "Between
[enter state date] and [enter end date]. The report
prints one page per townhome. The =sum([hoursworked])
section adds up the hours worked for the specified dates.

The way this report works is that people work hours each
month, and can be credited for a maximum of 32 hours per
month. So any hours over 32 in that month need to go
into carryover. And if on a future month they work less
than 32 hours and have some time in carryover, then the
carryover should be used (up to a maximum of 32 hours of
carryover and actual hours for the month).

People are able to get a $12 per hour credit for
community service performed to a maximum of 32 hours per
month and this report is to show the status on the
monetary value of the hours worked during the month, and
also how many carryover hours they have. Any community
service they perform over 32 hours will go into a
carryover field. If they ever go under 32 hours in a
month, then carryover hours should be added to the actual
hours, up to a maximum of 32 hours per month. So the
carryover field will be constantly changing, either being
added to or subtracted from, depending on how many actual
hours are worked monthly.

How would I create a second calculated field to store the
carryover number? And is this the correct way to handle
it?

Any help is much appreciated.
-----Original Message-----
Hi Laura
I'm afraid you'll have to supply more info.

John has attempted to give you an answer on how to
create the calculated field within a query.
That's what this is:
Carryover: IIF([Hours Worked] > 32, [Hours Worked] - 32, 0)


What is the Record Source for the report? Is it a query?
Are you showing everyone's hours or a single person's?

--
HTH
Dan Artuso, Access MVP


I need to write an expression that will use
the "HoursWorked" field. If the HoursWorked are 32 or
less then I would like the hours to be multiplied by 12.
If the Hours Worked are over 32, then 32 hours should be
calculated by 12 and the hours over 32 should be put in a
new field called Carryover. Hours are entered through
timesheets and the report I'm creating adds the total
hours for a specified time period, i.e.,
=sum([hoursworked]).

How would I create a second calculated field to store
the carryover number? And is this the right thing to do?
The way this report works, is that people work hours each
month, and can only be credited for 32 hours per month.
So any hours over 32 in that month need to go into
carryover. And if on a future month they work less than
32 hours and have some time in carryover, then the
carryover should be used (up to a maximum of 32 hours of
carryover and actual hours for the month).

Please share any ideas you may have, thank you!

Laura.


.
 
L

Laura

HI Dan,

I would love to have you take a look at the application I
created. It all works well, but this report is beyond my
knowledge. How could I get it to you?

I'm fairly new at all this.

Thanks,

Laura.
-----Original Message-----
Hi,
Okay, can you post the SQL for the query?
The easiest way would be to add the calculated field to that.

What is sum[hoursworked] actually summing?
Each townhome's hours worked?

Your query returns ALL townhome's hours worked?
Are you grouping by anything in your report?

Remember, we can't see your report or the query that feeds it and those
are the important things here.
If we can't solve this in the newsgroup, I'd be willing to take a look at a
copy of your db.

--
HTH
Dan Artuso, Access MVP


I need to write an expression for a report that will use
the "HoursWorked" field. If the HoursWorked are equal or
less than 32, then I would like the hours to be
multiplied by 12. If the Hours Worked are over 32, then
32 hours should be calculated by 12 and the hours over 32
should be put in a new field called Carryover. Hours are
entered through timesheet forms and the report I'm
creating adds the total hours for a specified time
period, i.e., =sum([hoursworked]). The record source is
a query that brings up three fields: townhome number,
hours worked and dates. The criteria for date is "Between
[enter state date] and [enter end date]. The report
prints one page per townhome. The =sum([hoursworked])
section adds up the hours worked for the specified dates.

The way this report works is that people work hours each
month, and can be credited for a maximum of 32 hours per
month. So any hours over 32 in that month need to go
into carryover. And if on a future month they work less
than 32 hours and have some time in carryover, then the
carryover should be used (up to a maximum of 32 hours of
carryover and actual hours for the month).

People are able to get a $12 per hour credit for
community service performed to a maximum of 32 hours per
month and this report is to show the status on the
monetary value of the hours worked during the month, and
also how many carryover hours they have. Any community
service they perform over 32 hours will go into a
carryover field. If they ever go under 32 hours in a
month, then carryover hours should be added to the actual
hours, up to a maximum of 32 hours per month. So the
carryover field will be constantly changing, either being
added to or subtracted from, depending on how many actual
hours are worked monthly.

How would I create a second calculated field to store the
carryover number? And is this the correct way to handle
it?

Any help is much appreciated.
-----Original Message-----
Hi Laura
I'm afraid you'll have to supply more info.

John has attempted to give you an answer on how to
create the calculated field within a query.
That's what this is:
Carryover: IIF([Hours Worked] > 32, [Hours Worked] -
32,
0)
What is the Record Source for the report? Is it a query?
Are you showing everyone's hours or a single person's?

--
HTH
Dan Artuso, Access MVP


I need to write an expression that will use
the "HoursWorked" field. If the HoursWorked are 32 or
less then I would like the hours to be multiplied by 12.
If the Hours Worked are over 32, then 32 hours
should
be
calculated by 12 and the hours over 32 should be put in a
new field called Carryover. Hours are entered through
timesheets and the report I'm creating adds the total
hours for a specified time period, i.e.,
=sum([hoursworked]).

How would I create a second calculated field to store
the carryover number? And is this the right thing
to
do?
The way this report works, is that people work hours each
month, and can only be credited for 32 hours per month.
So any hours over 32 in that month need to go into
carryover. And if on a future month they work less than
32 hours and have some time in carryover, then the
carryover should be used (up to a maximum of 32
hours
of
carryover and actual hours for the month).

Please share any ideas you may have, thank you!

Laura.




.


.
 
D

Dan Artuso

Hi Laura,
Okay, the first thing to do is compact your database.
That's on the Tools menu.
Make a copy of it.
Now rename it with a different extension, something like:
yourDb.dan
Anything with an mdb extension will be blocked by my Exchange server.
I'll rename it when I get it.

After you rename it, Zip it to reduce the size. I'm on a dial up connection (28.8).

Now, send it to danDOTartusoATnrc.ca

Replace DOT with . and AT with @

That's it. I'll take a look as soon as you send it.

--
HTH
Dan Artuso, Access MVP


Laura said:
HI Dan,

I would love to have you take a look at the application I
created. It all works well, but this report is beyond my
knowledge. How could I get it to you?

I'm fairly new at all this.

Thanks,

Laura.
-----Original Message-----
Hi,
Okay, can you post the SQL for the query?
The easiest way would be to add the calculated field to that.

What is sum[hoursworked] actually summing?
Each townhome's hours worked?

Your query returns ALL townhome's hours worked?
Are you grouping by anything in your report?

Remember, we can't see your report or the query that feeds it and those
are the important things here.
If we can't solve this in the newsgroup, I'd be willing to take a look at a
copy of your db.

--
HTH
Dan Artuso, Access MVP


I need to write an expression for a report that will use
the "HoursWorked" field. If the HoursWorked are equal or
less than 32, then I would like the hours to be
multiplied by 12. If the Hours Worked are over 32, then
32 hours should be calculated by 12 and the hours over 32
should be put in a new field called Carryover. Hours are
entered through timesheet forms and the report I'm
creating adds the total hours for a specified time
period, i.e., =sum([hoursworked]). The record source is
a query that brings up three fields: townhome number,
hours worked and dates. The criteria for date is "Between
[enter state date] and [enter end date]. The report
prints one page per townhome. The =sum([hoursworked])
section adds up the hours worked for the specified dates.

The way this report works is that people work hours each
month, and can be credited for a maximum of 32 hours per
month. So any hours over 32 in that month need to go
into carryover. And if on a future month they work less
than 32 hours and have some time in carryover, then the
carryover should be used (up to a maximum of 32 hours of
carryover and actual hours for the month).

People are able to get a $12 per hour credit for
community service performed to a maximum of 32 hours per
month and this report is to show the status on the
monetary value of the hours worked during the month, and
also how many carryover hours they have. Any community
service they perform over 32 hours will go into a
carryover field. If they ever go under 32 hours in a
month, then carryover hours should be added to the actual
hours, up to a maximum of 32 hours per month. So the
carryover field will be constantly changing, either being
added to or subtracted from, depending on how many actual
hours are worked monthly.

How would I create a second calculated field to store the
carryover number? And is this the correct way to handle
it?

Any help is much appreciated.

-----Original Message-----
Hi Laura
I'm afraid you'll have to supply more info.

John has attempted to give you an answer on how to
create the calculated field within a query.
That's what this is:
Carryover: IIF([Hours Worked] > 32, [Hours Worked] - 32,
0)


What is the Record Source for the report? Is it a query?
Are you showing everyone's hours or a single person's?

--
HTH
Dan Artuso, Access MVP


I need to write an expression that will use
the "HoursWorked" field. If the HoursWorked are 32 or
less then I would like the hours to be multiplied by
12.
If the Hours Worked are over 32, then 32 hours should
be
calculated by 12 and the hours over 32 should be put
in a
new field called Carryover. Hours are entered through
timesheets and the report I'm creating adds the total
hours for a specified time period, i.e.,
=sum([hoursworked]).

How would I create a second calculated field to store
the carryover number? And is this the right thing to
do?
The way this report works, is that people work hours
each
month, and can only be credited for 32 hours per month.
So any hours over 32 in that month need to go into
carryover. And if on a future month they work less
than
32 hours and have some time in carryover, then the
carryover should be used (up to a maximum of 32 hours
of
carryover and actual hours for the month).

Please share any ideas you may have, thank you!

Laura.




.


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top