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

Multiple Date Parameters

Status
Not open for further replies.

tonymerseyfire

Technical User
Jul 24, 2009
3
GB
Hi,

I have 3 Different Date fields called (UDAYK, UEVEK, UWEEK) which correspond to different visit dates to a property; each property has its own unique Account Number. When a date is recorded in either of the 3 fields another field is related which contains the outcome code from the Visit. This outcome code could have related to a population in any of the 3 date fields.

Basically I am trying to run each date field 'from' and 'to' for the same period. I have done this by setting up a parameter for date field and tried running the same dates for each;

{?UDAYKFrom} to {?UDAYKTo} and
{?UEVEKFrom} to {?UEVEKTO} and
{?UWEEKFrom} to {?UWEEKTO} and
{outcome code field} = "Value"

This gives me 6 different parameters to select dates from and to. It does not bring back the expected number of values from the {outcome code field} only around 20, when there should be alot more for the date range I specified in each parameter.

Not sure if there is something in the parameters I have missed or if there is another way to run 3 date fields from and to the same dates?

Any help, advice appreciated.

Thanks.
 
Your test says and, meaning that all three date tests must apply. Maybe you need
Code:
({?UDAYKFrom} to {?UDAYKTo} or
{?UEVEKFrom} to {?UEVEKTO} or
{?UWEEKFrom} to {?UWEEKTO})
 and 
{outcome code field} = "Value"
You could also get a failure if you hit a null. If the first fix does not work, put each test in its own formula field, e.g.
Code:
{?UEVEKFrom} to {?UEVEKTO}
Remove the selection and put all four in a test detail line, to see if you get True or False, or a space if you hit a null.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 10 & 11.5 with Windows XP [yinyang]
 
If all parameters are date parameters, then you can just use:

(
(
not isnull({table.udayk}) and
{table.udayk} in {?Start} to {?End}
) or
(
not isnull({table.uevek}) and
{table.uevek} in {?Start} to {?End}
) or
(
not isnull({table.uweek}) and
{table.uweek} in {?Start} to {?End}
)
) and
{table.outcomecodefield} = "Value"

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top