Need help to create a SUM IIF

M

Marco

Hello. I need help to create a SUM IFF function.

I need to sum all HoraMarcacao if CodigoMarcacao = "L" so then I'll copy to
another textbox and I will made equal HoraMarcacao if CodigoMarcacao = "M"
and then on another textbox I will calculate the diference between and then I
will divide by 1439 and after I will format has short time.

If you know a way to do this on only one text box, please just let me know.


Regards,
Marco
 
D

Duane Hookom

Without completely understanding your requirements, you can Sum() fields
where some expression is true with a calculation like:
=Sum(Abs([CodigoMarcacao]="L") * [HoraMarcacao])
 
M

Marco

Hello. thanks, it worked very well.

why the abs and the *

Regards,
Marco

Duane Hookom said:
Without completely understanding your requirements, you can Sum() fields
where some expression is true with a calculation like:
=Sum(Abs([CodigoMarcacao]="L") * [HoraMarcacao])

--
Duane Hookom
Microsoft Access MVP


Marco said:
Hello. I need help to create a SUM IFF function.

I need to sum all HoraMarcacao if CodigoMarcacao = "L" so then I'll copy to
another textbox and I will made equal HoraMarcacao if CodigoMarcacao = "M"
and then on another textbox I will calculate the diference between and then I
will divide by 1439 and after I will format has short time.

If you know a way to do this on only one text box, please just let me know.


Regards,
Marco
 
D

Duane Hookom

The expression inside the Abs() will evaluate to either true/-1 or false/0.
Using Abs() changes these to either 1 or 0. Mulitplying 0 times any value
results in 0 so the Sum() ignores the value.

--
Duane Hookom
Microsoft Access MVP


Marco said:
Hello. thanks, it worked very well.

why the abs and the *

Regards,
Marco

Duane Hookom said:
Without completely understanding your requirements, you can Sum() fields
where some expression is true with a calculation like:
=Sum(Abs([CodigoMarcacao]="L") * [HoraMarcacao])

--
Duane Hookom
Microsoft Access MVP


Marco said:
Hello. I need help to create a SUM IFF function.

I need to sum all HoraMarcacao if CodigoMarcacao = "L" so then I'll copy to
another textbox and I will made equal HoraMarcacao if CodigoMarcacao = "M"
and then on another textbox I will calculate the diference between and then I
will divide by 1439 and after I will format has short time.

If you know a way to do this on only one text box, please just let me know.


Regards,
Marco
 

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