Need help to create a SUM IIF

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
Without completely understanding your requirements, you can Sum() fields
where some expression is true with a calculation like:
=Sum(Abs([CodigoMarcacao]="L") * [HoraMarcacao])
 
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
 
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
 
Back
Top