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!

Select Expert

Status
Not open for further replies.

jello212

Technical User
Jun 19, 2007
29
US
I have the following formula. It's 3 completely self contained conditions - let's call them A, B, and C. Only one of the 3 conditions must be met in order for the row to apply. Assuming the 3 conditions are in the order A,B,C, A & B are working correctly. Rows that meet condition C do not appear. If I rearrange the conditions so that they are in C, A, B order, C & A work correctly but B does not. And like wise, if I make the order C, B, A, then C & B work fine and A doesn't work. I don't see how the order can affect them so since each is self contained - each is enclosed within parenthesis - and they are joined with an OR statement.


(
({vwGenVouchInfo.Update_Status} in [1, 2, 3] and {vwGenSvcInfo.Posting_Date} = {?Dt Range}) or
({vwGenVouchInfo.Update_Status} = 3 and {vwGenVouchInfo.Date_Voided} = {?Dt Range})
)

or

(
(isnull({vwGenSvcPmtInfo.Service_Payment_ID}) = false and
({vwGenSvcPmtInfo.Update_Status} in [1,2,3] and {vwGenSvcPmtInfo.Posting_Date} = {?Dt Range}) or
({vwGenSvcPmtInfo.Update_Status} = 3 and {vwGenSvcPmtInfo.Date_Voided} = {?Dt Range})
)
)


or


(
(isnull({Unassigned_Transactions.Unassigned_Transaction_ID}) = false and
({Unassigned_Transactions.Update_Status} in [1,2,3] and {Unassigned_Transactions.Date_Updated} = {?Dt Range}) or
({Unassigned_Transactions.Update_Status} = 3 and {Unassigned_Transactions.Date_Voided} = {?Dt Range})
)
)
 
Never mind. It was a problem with the placement of the parenthesis.

Mods, feel free to delete.
 
With complex commands, it's often easier to put them in formula fields as boolians, e.g.
Code:
({vwGenVouchInfo.Update_Status} in [1, 2, 3] and {vwGenSvcInfo.Posting_Date}  = {?Dt Range}) 
or
({vwGenVouchInfo.Update_Status} =   3        and {vwGenVouchInfo.Date_Voided} = {?Dt Range})
This could be displayed on the report and would appear as True or False (or blank if you hit a null without testing for it.) You could then put it in the record selection as just @Test1.

You can have a whole series for formula fields referenced by other formula fields/

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top