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!

If, Then derived field "Missing operands?"

Status
Not open for further replies.

jveschio

Technical User
May 9, 2005
3
US
Hi,

I am trying to create a if, then function in a derived field. I am using ADP PC Payroll 4.5 and Reportsmith 4.2 SQL database. The field keeps returning "Not enough operands". The field is below:

@IF(REPORTS.V_EMPLOYEE.ANNUALSALARY/12>8333,8333,REPORTS.V_EMPLOYEE.ANNUALSALARY/12)

What am I doing wrong?
 
Did you ever get an answer to this? I am trying to do the same thing.
 
This is how @If works....

@IF(number,value1,value2)

Return value1 If number Is Not Zero
Return value2 If number Is Zero Or NULL

=========================================================

gross_pay / @IF(hours,hours,1)

IF hours <> 0
THEN hours
ELSE 1

=========================================================

@IF(test,’YES’,’NO’)

IF test <> 0
THEN ‘YES’
ELSE ‘NO’


CharlesCook.com
ADP - PeopleSoft - SAP
ReportSmith - Crystal Reports - SQR - Query - Access
Reporting - Interfaces - Data Mining
 
The book I have from ADP indicates that @IF is true if the test parameter is non-zero but then adds parenthetically (greater than or equal to 1). Does this mean a negative value would make the @IF statement false?

I don't have a specific application, but can think of way that I would use this if that is correct.
 
This is from the gupta SQL syntax book:

@IF(number,value1,value2)

Return value1 If number Is Not Zero
Return value2 If number Is Zero Or NULL

Try it, I think @IF(-1,'YES','NO') will return YES.

My book is a little old so they could have changed it. The best way to find out is to test it.




CharlesCook.com
ADP - PeopleSoft - SAP
ReportSmith - Crystal Reports - SQR - Query - Access
Reporting - Interfaces - Data Mining
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top