I keep getting this "A string is required here", error (on the last if statement, ({@count2})) on this formula (I hope I am giving you enough information):
If {?p_Department} = "Yes" and
{?p_Excel} = "Yes" then {?p_Excel}
Else (If ({?p_Technician}={Command.usr_id})Then
(If({?p_Excel} = "No") then
(if({@Count1} > 1) and
(isnumeric({@UserIdSum2}))=True
then
(Val({@UserIdSum2})))))
This is being on a sub-report (mind you I am trying to fix someone else's work with no comments as to what and where things are).
Here are the formulas the are refered to within this statement:
{@Count1} =
if (Count({Command.usr_id},{Command.usr_id})> 1)
Then 1
Else 2;
{@count2} =
if ({@Count1})=1
Then "Yes"
Else "No";
{@UserIdSum2}=
WhilePrintingRecords;
Global numbervar TechSum:=
(Sum ({@BATSV}, {Command.usr_id});
Sum ({@BERV}, {Command.usr_id});
Sum ({@BML}, {Command.usr_id});
Sum ({@BLUE}, {Command.usr_id});
Sum ({@DEMO}, {Command.usr_id});
Sum ({@FL}, {Command.usr_id});
Sum ({@HL}, {Command.usr_id});
Sum ({@HOLI}, {Command.usr_id});
Sum ({@INJRY}, {Command.usr_id});
Sum ({@JURY}, {Command.usr_id});
Sum ({@LTR HL}, {Command.usr_id});
Sum ({@M RENT}, {Command.usr_id});
Sum ({@NEW E}, {Command.usr_id});
Sum ({@AFA}, {Command.usr_id});
Sum ({@NPL}, {Command.usr_id});
Sum ({@PM}, {Command.usr_id});
Sum ({@PL}, {Command.usr_id});
Sum ({@PRT DR}, {Command.usr_id});
Sum ({@PERSL}, {Command.usr_id});
Sum ({@RECAP}, {Command.usr_id});
Sum ({@RESTK}, {Command.usr_id});
Sum ({@SFTY}, {Command.usr_id});
Sum ({@SALES}, {Command.usr_id});
Sum ({@ST}, {Command.usr_id});
Sum ({@SL}, {Command.usr_id});
Sum ({@SHOP M}, {Command.usr_id});
Sum ({@S TRNG}, {Command.usr_id});
Sum ({@SICK}, {Command.usr_id});
Sum ({@SPS}, {Command.usr_id});
Sum ({@STR HL}, {Command.usr_id});
Sum ({@SUP}, {Command.usr_id});
Sum ({@TIRE P}, {Command.usr_id});
Sum ({@TL SUP}, {Command.usr_id});
Sum ({@TRN}, {Command.usr_id});
Sum ({@USED E}, {Command.usr_id});
Sum ({@UTLTY}, {Command.usr_id});
Sum ({@VAC}, {Command.usr_id});
Sum ({@TotHours}, {Command.usr_id}));
All of the Sum({@XXXX) =
WhilePrintingRecords;
numbervar AFA := 0;
AFA := sum({@AFA},{Command.bra_id});
If AFA >= 1 then
Totext(fix (AFA),0) + "." + Totext(Remainder(AFA,fix (AFA))*60 ,0)
else if (AFA < 1 and AFA > 0) Then
"." + Totext(AFA*60 ,0)
else
Totext(fix(AFA),0)
If {?p_Department} = "Yes" and
{?p_Excel} = "Yes" then {?p_Excel}
Else (If ({?p_Technician}={Command.usr_id})Then
(If({?p_Excel} = "No") then
(if({@Count1} > 1) and
(isnumeric({@UserIdSum2}))=True
then
(Val({@UserIdSum2})))))
This is being on a sub-report (mind you I am trying to fix someone else's work with no comments as to what and where things are).
Here are the formulas the are refered to within this statement:
{@Count1} =
if (Count({Command.usr_id},{Command.usr_id})> 1)
Then 1
Else 2;
{@count2} =
if ({@Count1})=1
Then "Yes"
Else "No";
{@UserIdSum2}=
WhilePrintingRecords;
Global numbervar TechSum:=
(Sum ({@BATSV}, {Command.usr_id});
Sum ({@BERV}, {Command.usr_id});
Sum ({@BML}, {Command.usr_id});
Sum ({@BLUE}, {Command.usr_id});
Sum ({@DEMO}, {Command.usr_id});
Sum ({@FL}, {Command.usr_id});
Sum ({@HL}, {Command.usr_id});
Sum ({@HOLI}, {Command.usr_id});
Sum ({@INJRY}, {Command.usr_id});
Sum ({@JURY}, {Command.usr_id});
Sum ({@LTR HL}, {Command.usr_id});
Sum ({@M RENT}, {Command.usr_id});
Sum ({@NEW E}, {Command.usr_id});
Sum ({@AFA}, {Command.usr_id});
Sum ({@NPL}, {Command.usr_id});
Sum ({@PM}, {Command.usr_id});
Sum ({@PL}, {Command.usr_id});
Sum ({@PRT DR}, {Command.usr_id});
Sum ({@PERSL}, {Command.usr_id});
Sum ({@RECAP}, {Command.usr_id});
Sum ({@RESTK}, {Command.usr_id});
Sum ({@SFTY}, {Command.usr_id});
Sum ({@SALES}, {Command.usr_id});
Sum ({@ST}, {Command.usr_id});
Sum ({@SL}, {Command.usr_id});
Sum ({@SHOP M}, {Command.usr_id});
Sum ({@S TRNG}, {Command.usr_id});
Sum ({@SICK}, {Command.usr_id});
Sum ({@SPS}, {Command.usr_id});
Sum ({@STR HL}, {Command.usr_id});
Sum ({@SUP}, {Command.usr_id});
Sum ({@TIRE P}, {Command.usr_id});
Sum ({@TL SUP}, {Command.usr_id});
Sum ({@TRN}, {Command.usr_id});
Sum ({@USED E}, {Command.usr_id});
Sum ({@UTLTY}, {Command.usr_id});
Sum ({@VAC}, {Command.usr_id});
Sum ({@TotHours}, {Command.usr_id}));
All of the Sum({@XXXX) =
WhilePrintingRecords;
numbervar AFA := 0;
AFA := sum({@AFA},{Command.bra_id});
If AFA >= 1 then
Totext(fix (AFA),0) + "." + Totext(Remainder(AFA,fix (AFA))*60 ,0)
else if (AFA < 1 and AFA > 0) Then
"." + Totext(AFA*60 ,0)
else
Totext(fix(AFA),0)