Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Summarize Formules 1

Status
Not open for further replies.

striddies

Technical User
Jun 9, 2009
3
0
0
NL
I want to summarize different formules and ik can't let it work :-(

This is what I have done:

6 formules:

@Gift1:
if timevalue({Medicatie.medToedienTijd1}) >= timevalue({Medicatie.medTijdStart}) then 1 else 0
@Gift2:
if timevalue({Medicatie.medToedienTijd2}) >= timevalue({Medicatie.medTijdStart}) then 1 else 0
@Gift3:
if timevalue({Medicatie.medToedienTijd3}) >= timevalue({Medicatie.medTijdStart}) then 1 else 0
@Gift4:
if timevalue({Medicatie.medToedienTijd4}) >= timevalue({Medicatie.medTijdStart}) then 1 else 0
@Gift5:
if timevalue({Medicatie.medToedienTijd5}) >= timevalue({Medicatie.medTijdStart}) then 1 else 0
@Gift6:
if timevalue({Medicatie.medToedienTijd6}) >= timevalue({Medicatie.medTijdStart}) then 1 else 0


And then 1 formule to summarize the above formules:

@Gifts:
@Gift1 + @Gift2 + @Gift3 + @Gift4 + @Gift5 + @Gift6

The first 6 formules are giving the correct answer, but when I want to summarize the formules it gives no answer at all.

Does someone have a solution my problem?
 
It would seem that one of the fields used in the formual is null.

Assuming {Medicatie.medTijdStart} can not be null try

@Gift1:
if isnull({Medicatie.medToedienTijd1}) then 0 else
if timevalue({Medicatie.medToedienTijd1}) >= timevalue({Medicatie.medTijdStart}) then 1 else 0

Repeat for other formula

Ian
 
Ian,

Thanks for the tip! It works now very well!
:)

Astrid
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top