A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Query calculation not working in form unless all fields contain va



 
 
Thread Tools Display Modes
  #1  
Old July 14th, 2006, 02:52 PM posted to microsoft.public.access.forms
KateCee
external usenet poster
 
Posts: 22
Default Query calculation not working in form unless all fields contain va

I've created a database to enter and access weekly employee schedules. I
have created a query that calculates hours worked per day, for each day
Sun-Sat. I also created a "weekly total # hrs" to calculate how many total
hrs per week an employee is scheduled for. I based the "weekly total # hrs"
on an sum function of all total # hrs for each day, Sun -Sat (entered these
individually in the query, for ex.
=[TotalSunday]+[TotalMonday]+[TotalTuesday]...etc.)

I created a form for entry of schedules, but have run into an issue that I
am sure is fairly easy to resolve - I just don't know how. Basically, I need
to be able to enter a checkbox field for each day (Sun-Sat) that would be
marked if the employee is not scheduled to work that day. As the form is
now, I do not have such an option, which I think is messing up my "weekly
total # hrs" calculation b/c the calculation does not show unless I have
entered shift values for each day of the week. I need to know how to make
this checkbox so that access does not consider a missing value in the total
calculation, b/c I am sure that is what is complicating my weekly total.

Thanks, I'd greatly appreciate any help with this issue.


  #2  
Old July 18th, 2006, 12:28 AM posted to microsoft.public.access.forms
Michel Walsh
external usenet poster
 
Posts: 2,404
Default Query calculation not working in form unless all fields contain va

Hi,

=Nz([TotalSunday],0)+Nz([TotalMonday],0)+Nz([TotalTuesday],0) + ...



The reason is that the Null value propagate. See Null as meaning "unknown,
yet". So, what is 4 + unknown ? well, it is unknown, which is null. So,
as soon as one null is in the formula, the result is also null. Using Nz, as
we did, change that null for zero (which is known, it is zero, it is not
unknown anymore).


Hoping it may help,
Vanderghast, Access MVP


"KateCee" wrote in message
...
I've created a database to enter and access weekly employee schedules. I
have created a query that calculates hours worked per day, for each day
Sun-Sat. I also created a "weekly total # hrs" to calculate how many
total
hrs per week an employee is scheduled for. I based the "weekly total #
hrs"
on an sum function of all total # hrs for each day, Sun -Sat (entered
these
individually in the query, for ex.
=[TotalSunday]+[TotalMonday]+[TotalTuesday]...etc.)

I created a form for entry of schedules, but have run into an issue that I
am sure is fairly easy to resolve - I just don't know how. Basically, I
need
to be able to enter a checkbox field for each day (Sun-Sat) that would be
marked if the employee is not scheduled to work that day. As the form is
now, I do not have such an option, which I think is messing up my "weekly
total # hrs" calculation b/c the calculation does not show unless I have
entered shift values for each day of the week. I need to know how to make
this checkbox so that access does not consider a missing value in the
total
calculation, b/c I am sure that is what is complicating my weekly total.

Thanks, I'd greatly appreciate any help with this issue.




  #3  
Old July 21st, 2006, 02:28 PM posted to microsoft.public.access.forms
KateCee
external usenet poster
 
Posts: 22
Default Query calculation not working in form unless all fields contai

Thanks! Worked like a charm...

And your explanation totally makes sense, thanks for explaining so well and
helping me out.

Kate

"Michel Walsh" wrote:

Hi,

=Nz([TotalSunday],0)+Nz([TotalMonday],0)+Nz([TotalTuesday],0) + ...



The reason is that the Null value propagate. See Null as meaning "unknown,
yet". So, what is 4 + unknown ? well, it is unknown, which is null. So,
as soon as one null is in the formula, the result is also null. Using Nz, as
we did, change that null for zero (which is known, it is zero, it is not
unknown anymore).


Hoping it may help,
Vanderghast, Access MVP


"KateCee" wrote in message
...
I've created a database to enter and access weekly employee schedules. I
have created a query that calculates hours worked per day, for each day
Sun-Sat. I also created a "weekly total # hrs" to calculate how many
total
hrs per week an employee is scheduled for. I based the "weekly total #
hrs"
on an sum function of all total # hrs for each day, Sun -Sat (entered
these
individually in the query, for ex.
=[TotalSunday]+[TotalMonday]+[TotalTuesday]...etc.)

I created a form for entry of schedules, but have run into an issue that I
am sure is fairly easy to resolve - I just don't know how. Basically, I
need
to be able to enter a checkbox field for each day (Sun-Sat) that would be
marked if the employee is not scheduled to work that day. As the form is
now, I do not have such an option, which I think is messing up my "weekly
total # hrs" calculation b/c the calculation does not show unless I have
entered shift values for each day of the week. I need to know how to make
this checkbox so that access does not consider a missing value in the
total
calculation, b/c I am sure that is what is complicating my weekly total.

Thanks, I'd greatly appreciate any help with this issue.





  #4  
Old April 17th, 2008, 05:11 PM posted to microsoft.public.access.forms
Gouri[_2_]
external usenet poster
 
Posts: 2
Default Query calculation not working in form unless all fields contain va

Kate,
Can you please send how the timesheet and the related forms are created. I
am looking to create the time sheet data base which keeps track of the
employees time for a project on daily/weekly basis.
Thanks,
Gouri

"KateCee" wrote:

I've created a database to enter and access weekly employee schedules. I
have created a query that calculates hours worked per day, for each day
Sun-Sat. I also created a "weekly total # hrs" to calculate how many total
hrs per week an employee is scheduled for. I based the "weekly total # hrs"
on an sum function of all total # hrs for each day, Sun -Sat (entered these
individually in the query, for ex.
=[TotalSunday]+[TotalMonday]+[TotalTuesday]...etc.)

I created a form for entry of schedules, but have run into an issue that I
am sure is fairly easy to resolve - I just don't know how. Basically, I need
to be able to enter a checkbox field for each day (Sun-Sat) that would be
marked if the employee is not scheduled to work that day. As the form is
now, I do not have such an option, which I think is messing up my "weekly
total # hrs" calculation b/c the calculation does not show unless I have
entered shift values for each day of the week. I need to know how to make
this checkbox so that access does not consider a missing value in the total
calculation, b/c I am sure that is what is complicating my weekly total.

Thanks, I'd greatly appreciate any help with this issue.


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:24 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.