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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formula Question

Status
Not open for further replies.

pineisland99

Instructor
Feb 13, 2007
22
US
I have the below field in my database:
(f320#loan status)
This field can have an answer of 'closed' or 'open'

I have the below formula in my report:
if {TRACKING_FILE_CUSTOMREPORT.f321#Closer} = 'TBANC New Construction' then
NewConstructionCount:= NewConstructionCount + 1;

I need the formula to run only when f320 is equal to 'open'

what type of verbage can I add to my formula.

Thank you
 
To clarify:

This is my formula:

if {TRACKING_FILE_CUSTOMREPORT.f321#Closer} = 'TBANC New Construction' then
NewConstructionCount:= NewConstructionCount + 1;

I need it to run only when field (f320#loan_status) is not equal to A, W or C.

I tried the below, but it errored out:
if {TRACKING_FILE_CUSTOMREPORT.f321#Closer} = 'TBANC New Construction' and (f320#loan_status) <> “A”, “W”, “C” then
NewConstructionCount:= NewConstructionCount + 1;

Thank You
 
whileprintingrecords;
numbervar NewConstructionCount;

if {TRACKING_FILE_CUSTOMREPORT.f321#Closer} = 'TBANC New Construction' and
not({f320#loan_status} in [“A”, “W”, “C”]) then
NewConstructionCount:= NewConstructionCount + 1;

-LB
 
OK!

edited my formula as below, however am getting an error of type: "A number, currency amount, boolean, date, time, date-time, or string is expected here."

The error appears to be pointing to the [“R”, “W”, “C”]) piece.
My values in this field are strings.

if {TRACKING_FILE_CUSTOMREPORT.f321#Closer} = 'TBANC New Construction'
and not({TRACKING_FILE_CUSTOMREPORT.f463#Status} in [“R”, “W”, “C”])
then NewConstructionCount:= NewConstructionCount + 1;
 
Please show the entire formula when posting (you keep leaving out the initializing variable). I don't see why you would get that error if the field is in fact a string. Can you verify that the field returns results that equal "R","W","C"?

-LB
 
Appreciate the help. I ended up modifying the code as below and it worked

if {TRACKING_FILE_CUSTOMREPORT.f463#Status} <> "C" then
if {TRACKING_FILE_CUSTOMREPORT.f463#Status} <> "R" then
if {TRACKING_FILE_CUSTOMREPORT.f463#Status} <> "W" then
if {TRACKING_FILE_CUSTOMREPORT.f321#Closer} = 'TBANC New Construction' then
NewConstructionCount:= NewConstructionCount + 1;

Thank you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top