PC Review


Reply
Thread Tools Rate Thread

Calculating with several fields

 
 
bob
Guest
Posts: n/a
 
      26th Jul 2008
The postings that i did get for time worked great. Now the issue is that i
want to link the fields together so it will calculate all the mons that are
left and pay a rate to that time. I have that part, that is take that field
and times it by a number. so here is what it looks like

Time IN 12:00:00 pm Time In 12:00:00pm Time In 12:00:00
Time out 13:00:00 pm Time out 13:30:00 pm Time out 13:45:00 pm
Delay Time 45 Delay Time 45 Delay Time 45
Total Time 15 Total Time 30 Total Time 45

now what i need to do is to add them up and if there is is not one that has
anything in it that is will still calculate it. Meaning that if 1 and 2 are
filled or just one is filled it will still calculate or add it up. I know
that their need to be fields for the toal time and the pay. what i need is
what to put for the null factor. if more info is need please ask

Thank you for your time
 
Reply With Quote
 
 
 
 
Chris O''''Neill
Guest
Posts: n/a
 
      26th Jul 2008
If I'm understanding your question correctly, you want to know how to make
sure a NULL field won't blow-up your calculations? That would be the NZ()
function:

NZ(fieldname,what-to-replace-NULL-with)

For instance:

NZ(Me.TotalTime,0) will put a zero in the TotalTime field if it is NULL.
So...

Me.Rate * Me.TotalTime will result in an error if TotalTime is NULL, but
Me.Rate * NZ(Me.TotalTime,0) will result in zero if TotalTime is NULL

Hope that helps...

Regards, Chris

P.S. Your calculations are wrong. The Total Tie for the middle column
should be 45 minutes, and the total time for the far right column should be 1
hour. Ya got the first column right, though!

"bob" wrote:

> The postings that i did get for time worked great. Now the issue is that i
> want to link the fields together so it will calculate all the mons that are
> left and pay a rate to that time. I have that part, that is take that field
> and times it by a number. so here is what it looks like
>
> Time IN 12:00:00 pm Time In 12:00:00pm Time In 12:00:00
> Time out 13:00:00 pm Time out 13:30:00 pm Time out 13:45:00 pm
> Delay Time 45 Delay Time 45 Delay Time 45
> Total Time 15 Total Time 30 Total Time 45
>
> now what i need to do is to add them up and if there is is not one that has
> anything in it that is will still calculate it. Meaning that if 1 and 2 are
> filled or just one is filled it will still calculate or add it up. I know
> that their need to be fields for the toal time and the pay. what i need is
> what to put for the null factor. if more info is need please ask
>
> Thank you for your time

 
Reply With Quote
 
bob
Guest
Posts: n/a
 
      26th Jul 2008
Chris thank you for the help
the calculation works great. After i wrote this i figured it out with the Nz
sign.

here is a easy question the there anywhere on the net that has all the sign
or what ever they are called. I do know that there is different letters for
different purposes.
Iam kind of new at this.

"Chris O''''Neill" wrote:

> If I'm understanding your question correctly, you want to know how to make
> sure a NULL field won't blow-up your calculations? That would be the NZ()
> function:
>
> NZ(fieldname,what-to-replace-NULL-with)
>
> For instance:
>
> NZ(Me.TotalTime,0) will put a zero in the TotalTime field if it is NULL.
> So...
>
> Me.Rate * Me.TotalTime will result in an error if TotalTime is NULL, but
> Me.Rate * NZ(Me.TotalTime,0) will result in zero if TotalTime is NULL
>
> Hope that helps...
>
> Regards, Chris
>
> P.S. Your calculations are wrong. The Total Tie for the middle column
> should be 45 minutes, and the total time for the far right column should be 1
> hour. Ya got the first column right, though!
>
> "bob" wrote:
>
> > The postings that i did get for time worked great. Now the issue is that i
> > want to link the fields together so it will calculate all the mons that are
> > left and pay a rate to that time. I have that part, that is take that field
> > and times it by a number. so here is what it looks like
> >
> > Time IN 12:00:00 pm Time In 12:00:00pm Time In 12:00:00
> > Time out 13:00:00 pm Time out 13:30:00 pm Time out 13:45:00 pm
> > Delay Time 45 Delay Time 45 Delay Time 45
> > Total Time 15 Total Time 30 Total Time 45
> >
> > now what i need to do is to add them up and if there is is not one that has
> > anything in it that is will still calculate it. Meaning that if 1 and 2 are
> > filled or just one is filled it will still calculate or add it up. I know
> > that their need to be fields for the toal time and the pay. what i need is
> > what to put for the null factor. if more info is need please ask
> >
> > Thank you for your time

 
Reply With Quote
 
Chris O''''Neill
Guest
Posts: n/a
 
      26th Jul 2008
You're welcome. Glad I can be of help for a change.

I'm pretty new to Access programming, too, so I'm not aware of an onlline
"dictionary" for all the VB/VBA functions. (Maybe someone else knows?) What
I do if I see a function I'm unfamiliar with is bring up the Access
expression builder, find it in the "All" list, and then hit F1 to call-up
Access Help. If the help is cryptic (and it often is), I'll do a search here
for it and will often find alot of good info. Finally, if that doesn't solve
it, I ask the question here and get tons of help.

Regards, Chris


"bob" wrote:

> Chris thank you for the help
> the calculation works great. After i wrote this i figured it out with the Nz
> sign.
>
> here is a easy question the there anywhere on the net that has all the sign
> or what ever they are called. I do know that there is different letters for
> different purposes.
> Iam kind of new at this.
>
> "Chris O''''Neill" wrote:
>
> > If I'm understanding your question correctly, you want to know how to make
> > sure a NULL field won't blow-up your calculations? That would be the NZ()
> > function:
> >
> > NZ(fieldname,what-to-replace-NULL-with)
> >
> > For instance:
> >
> > NZ(Me.TotalTime,0) will put a zero in the TotalTime field if it is NULL.
> > So...
> >
> > Me.Rate * Me.TotalTime will result in an error if TotalTime is NULL, but
> > Me.Rate * NZ(Me.TotalTime,0) will result in zero if TotalTime is NULL
> >
> > Hope that helps...
> >
> > Regards, Chris
> >
> > P.S. Your calculations are wrong. The Total Tie for the middle column
> > should be 45 minutes, and the total time for the far right column should be 1
> > hour. Ya got the first column right, though!
> >
> > "bob" wrote:
> >
> > > The postings that i did get for time worked great. Now the issue is that i
> > > want to link the fields together so it will calculate all the mons that are
> > > left and pay a rate to that time. I have that part, that is take that field
> > > and times it by a number. so here is what it looks like
> > >
> > > Time IN 12:00:00 pm Time In 12:00:00pm Time In 12:00:00
> > > Time out 13:00:00 pm Time out 13:30:00 pm Time out 13:45:00 pm
> > > Delay Time 45 Delay Time 45 Delay Time 45
> > > Total Time 15 Total Time 30 Total Time 45
> > >
> > > now what i need to do is to add them up and if there is is not one that has
> > > anything in it that is will still calculate it. Meaning that if 1 and 2 are
> > > filled or just one is filled it will still calculate or add it up. I know
> > > that their need to be fields for the toal time and the pay. what i need is
> > > what to put for the null factor. if more info is need please ask
> > >
> > > Thank you for your time

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculating Fields gp Microsoft Access Getting Started 3 23rd Feb 2010 08:10 PM
calculating fields Joryly Microsoft Access 2 7th Nov 2008 06:20 PM
calculating fields Flores Microsoft Access 0 8th Oct 2008 06:41 PM
Calculating fields in a form from combo fields Jay Microsoft Access 2 19th Jan 2006 08:11 PM
Calculating the sum of all fields in a row Spidey3721 Microsoft Access 10 17th Nov 2003 12:30 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:54 AM.