Calculations

L

lost

I have a database that is tracking and calculating crew hours on a job. The
issue I have run into is thta I can't get it to use one or the other. It
keeps trying to run both of them at the same time. one is this one Total
hours test: IIf([payF]>1,IIf([Punch IN Time]=0,+([Punch Out Time]-[Job site
arrival])*24-0.5,+([Job Site Departure]-[Job site Arrival])*24),0)

The other one is this one T-HRS-F: IIf([payf]>1,IIf([Punch Out
Time]>0,+([Punch Out Time]-[Punch In Time])*24-0.5,+([Job Site
Departure]-[Punch In Time])*24),0)

I want to run both in the same field in the query. The reason is if a crew
is done early at one job and goes to start another that day we want to track
how long they were there and what the cost of the job was. I have everything
working but this issue. It won't reconise each formula as it's own. It keeps
p[utting both of them together and running them thus giving the wrong answer.
If I break it into two fields it works.

Please help.
 
J

Jeff Boyce

Any chance the underlying "punch time" fields are date/time fields?

I don't understand why you couldn't use each formula in a separate field in
a query, returning both results?
 
J

Jeff Boyce

Access doesn't have "time fields". Access has Date/Time fields. If you can
only see the time in those fields, they have a format set to display that
way. That does NOT change what is stored in the fields.

I don't understand -- you have two separate calculations but you want to
display them as one?

If you want to concatenate two separate fields (?calculations) in one report
field, you can easily do that. Just create a new, unbound control on your
report and make it's Control Source something like:

=[YourFirstField] & " " & [YourSecondField]

Note that this will insert a space between the two.
 

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