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

Report Criteria Or statement

Status
Not open for further replies.

kimchavis

Technical User
Jan 7, 2004
66
US
I dont know why im having such a problem with this:

Using CRv10

Im trying to pull back if any of these three fields (dates): EscrowReconLoanBillingTask.OpenDate,
EscrowReconLoanBillingTask.ClosedDate,
EscrowReconLoanDisbursementTask.OpenDate

are in my Parameter date range. Does this need to be in a loop? If so, can i get some assistance on how to write this? Any help would be greatly appreciated!!!

Thanks!
KIM
 
I don't know what you mean by "pull back". Can you explain?
MrBill
 
Im putting this in the record selection. By pull back i mean query.
 
Im sorry i forgot to put in the statement Im using:

minimum({?Enter Date Range}) to maximum({?Enter Date Range}) ={Tasks.dbo_EscrowReconLoanBillingTask.OpenDate}
or
minimum({?Enter Date Range}) to maximum({?Enter Date Range}) ={Tasks.dbo_EscrowReconLoanBillingTask.ClosedDate}
or
minimum({?Enter Date Range}) to maximum({?Enter Date Range}) ={Tasks.dbo_EscrowReconLoanDisbursementTask.OpenDate}
 
You should let us know whether you want to allow any null dates. Otherwise you can use:

{EscrowReconLoanBillingTask.OpenDate} = {?daterange} or
{EscrowReconLoanBillingTask.ClosedDate} = {?daterange} or
{EscrowReconLoanDisbursementTask.OpenDate} = {?daterange}

-LB
 
Any or all of these values can be null or in another date range. If any of them are in my parameter date range i want it to show on my report.
 
It will pull back the first line of criteria back correctly, however, if the first date({EscrowReconLoanBillingTask.OpenDate}) is null then it wont move to the second line. I have tried adding if statements/or isnull and nothing seems to be working. I appreciate any help you can provide.

Thanks!!
 
The problem is that when you select on these fields, it will eliminate rows that have nulls, and may eliminate values in other fields that you actually want to appear. I think you would be better off using a command as your datasource where you can specify the selection in individual parts of the union statement. I would copy your current SQL into the command, and then remove the selection criteria and add one set of criteria per union segment, and then copy the query again and repeat:

select //etc.
from//etc.
where
EscrowReconLoanBillingTask.`OpenDate` = {?daterange}

union

select //etc.
from//etc.
where
EscrowReconLoanBillingTask.`ClosedDate` = {?daterange}

union

select //etc.
from//etc.
where
EscrowReconLoanDisbursementTask.`OpenDate` = {?daterange}

The advantage of this is that it will limit the volume of records that are returned to the report also, but without incorrectly excluding desired records.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top