Hi:
I am new to Crystal Decisions' Crystal Reports. I am using version 8.5 and I am having problems with formulas. This is my first formula.
I had a complex report in Access 2000 that used the following nested immediate IF statement for a calclaued field on the report:
=(IIf([RCost]>0,[RDescription],(IIf([NRCost]>0,[NRDescription],(IIf([NRManpower] Is Not Null,"Manpower Workyear Cost"))))))
RCost, NRCost, NRManpower is a number (real)datatype field, and RDescription is a text(nvarchar) field.
I searched Crystal Report's help menu and found out that I can use the same IIF function as in Access 2000,
IIF(expression, truePart, falsePart).
I'm am using SQL Server 2000 with Crystal Reports, not Access 2000. (Just converting the Access 2000 database).
I took the same nested IIF statement mentioned above, and tried to convert it to a formula using Crystal Report's syntax in the Record Selectin Formula Editor, see the following:
IIF({qryAnnex_View.RCost}>0,{qryAnnex_View.RDescription},IIf({qryAnnex_View.NRCost}>0,{qryAnnex_View.NRDescription},(IIf(Not IsNull({qryAnnex_View.NRManpower}),"Manpower Workyear Cost"))))
When I tried to validate this formula (Check: Alt+C), I received the following error message:
Not enough arguments have been given to this function.
What am I doing wrong? I'm only trying to convert the nested IIf statement in Access to a formula in Crystal Reports.
Could I do it better using a If..Else formula statement?
If so, how?
Thanks,
Cheryl3D
I am new to Crystal Decisions' Crystal Reports. I am using version 8.5 and I am having problems with formulas. This is my first formula.
I had a complex report in Access 2000 that used the following nested immediate IF statement for a calclaued field on the report:
=(IIf([RCost]>0,[RDescription],(IIf([NRCost]>0,[NRDescription],(IIf([NRManpower] Is Not Null,"Manpower Workyear Cost"))))))
RCost, NRCost, NRManpower is a number (real)datatype field, and RDescription is a text(nvarchar) field.
I searched Crystal Report's help menu and found out that I can use the same IIF function as in Access 2000,
IIF(expression, truePart, falsePart).
I'm am using SQL Server 2000 with Crystal Reports, not Access 2000. (Just converting the Access 2000 database).
I took the same nested IIF statement mentioned above, and tried to convert it to a formula using Crystal Report's syntax in the Record Selectin Formula Editor, see the following:
IIF({qryAnnex_View.RCost}>0,{qryAnnex_View.RDescription},IIf({qryAnnex_View.NRCost}>0,{qryAnnex_View.NRDescription},(IIf(Not IsNull({qryAnnex_View.NRManpower}),"Manpower Workyear Cost"))))
When I tried to validate this formula (Check: Alt+C), I received the following error message:
Not enough arguments have been given to this function.
What am I doing wrong? I'm only trying to convert the nested IIf statement in Access to a formula in Crystal Reports.
Could I do it better using a If..Else formula statement?
If so, how?
Thanks,
Cheryl3D