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

And Or statement for a report

Status
Not open for further replies.

umpire115

IS-IT--Management
May 10, 2013
1
US
Good evening everyone. I need some help. By my own admission, I am not the sharpest tool in the shed So any help with this would be great.

I am join two tables:

Customer Table with the field of Customer Number
Procedure Table with the fields of End Date, Ending Date, and Procedure name ( I didn't name the tables and have no idea why there is end and ending)


I want to find records for a certain customer number AND the End OR Ending date are in a certain range. Some procedures only have data in the end date and other procedures only have stuff in the ending date field. I want to look for a date range in either field.


I greatly appreciate everyone's help. It might help me keep my job. lol

 
I have made a few assumptions here, including:
1. The Customer Number and Date Ranges will be provided by way of parameters (I have referred to them as {?CustNumbParam} and {?DateRange});
2. The End and Ending fields are Date or Date/Time fields.

Try the following Record Selection formula:

Code:
{Customer.CustomerNumber} = {?CustNumbParam} and
(
	(	
		IsNull({Procedure.EndingDate}) and
		{Procedure.EndDate} = {?DateRange}
	)
	or
	(	
		IsNull({Procedure.EndDate}) and
		{Procedure.EndingDate} = {?DateRange}
	)
)

Replace the table/field names with the actual names from your data source.

Cheers
Pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top