I am attempting to use the following expression in a calculated field. Which is the proper way to use IsBlank? Expression 1 or expression 2? I've seen it both ways.
Additionally, both have a "Bad expression character" but I don't know what it is.
Expression 1:
Iif(Calc->Pvdrhrs.is_blank().and.Calc->OthrhrsVchrhrs,Calc->Vchrhrs-Calc->Othrhrs),
Iif(Calc->Pvdrhrs.is_blank().and.Calc->Vchrhrs.is_blank(),Calc->Vchrhrs),
IIF(Calc->OthrhrsVchrhrs,Calc->Vchrhrs-Calc->Othrhrs),
Iif(Calc->Pvdrhrs.and.Calc->OthrhrsVchrhrs,Calc->Vchrhrs-Calc->Othrhrs,Calc->Vchrhrs)
Expression 2
Iif(isblank(Calc->Pvdrhrs).and.Calc->OthrhrsVchrhrs,Calc->Vchrhrs-Calc->Othrhrs),
Iif(isblank(Calc->Pvdrhrs).and.(isblank(Calc->Vchrhrs),Calc->Vchrhrs),
IIF(Calc->OthrhrsVchrhrs,Calc->Vchrhrs-Calc->Othrhrs),
Iif(Calc->Pvdrhrs.and.Calc->OthrhrsVchrhrs,Calc->Vchrhrs-Calc->Othrhrs,Calc->Vchrhrs)
The following is/are presented for clarification and show the possibilities for the calculated fields. The numbers 6 and 9 have no significance other than to simply show a number and that the numbers in the OthrHrs column will be lower than the number in the Vchrhrs column.
PvdrHrs OthrHrs Vchrhrs
0 6 9
9 0 9
9 6 9
0 0 9
OR, am I missing the boat and I should be using something other than the isblank?
Man-O-Man., would I ever like to have a session on writing expressions at the conference. That alone would be worth the trip!!!!!!!!!!!!!!!!
Thanks,
kenn
Additionally, both have a "Bad expression character" but I don't know what it is.
Expression 1:
Iif(Calc->Pvdrhrs.is_blank().and.Calc->OthrhrsVchrhrs,Calc->Vchrhrs-Calc->Othrhrs),
Iif(Calc->Pvdrhrs.is_blank().and.Calc->Vchrhrs.is_blank(),Calc->Vchrhrs),
IIF(Calc->OthrhrsVchrhrs,Calc->Vchrhrs-Calc->Othrhrs),
Iif(Calc->Pvdrhrs.and.Calc->OthrhrsVchrhrs,Calc->Vchrhrs-Calc->Othrhrs,Calc->Vchrhrs)
Expression 2
Iif(isblank(Calc->Pvdrhrs).and.Calc->OthrhrsVchrhrs,Calc->Vchrhrs-Calc->Othrhrs),
Iif(isblank(Calc->Pvdrhrs).and.(isblank(Calc->Vchrhrs),Calc->Vchrhrs),
IIF(Calc->OthrhrsVchrhrs,Calc->Vchrhrs-Calc->Othrhrs),
Iif(Calc->Pvdrhrs.and.Calc->OthrhrsVchrhrs,Calc->Vchrhrs-Calc->Othrhrs,Calc->Vchrhrs)
The following is/are presented for clarification and show the possibilities for the calculated fields. The numbers 6 and 9 have no significance other than to simply show a number and that the numbers in the OthrHrs column will be lower than the number in the Vchrhrs column.
PvdrHrs OthrHrs Vchrhrs
0 6 9
9 0 9
9 6 9
0 0 9
OR, am I missing the boat and I should be using something other than the isblank?
Man-O-Man., would I ever like to have a session on writing expressions at the conference. That alone would be worth the trip!!!!!!!!!!!!!!!!
Thanks,
kenn
Comment