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

Two Static Date Parameters where only one can be selected

Status
Not open for further replies.

GayleC

Technical User
Apr 27, 2011
28
0
0
US
Hello,

I'm working in Crystal XI and have been asked to write a report which contains two separate dates. A Date of Service (DOS) and an Entry Date. The end user wants the report to be run by either the DOS or the Entry date but not both. For example run the report for a DOS of 5/1/15 regardless of the Entry date or run the report for an Entry date of 5/1/15 regardless of the DOS. The end results would look some thing like this:

DOS 5/1/15:

Date Of Svc Date Of Entry
5/1/2015 5/5/2015
5/1/2015 5/5/2015
5/1/2015 5/5/2015
5/1/2015 5/5/2015
5/1/2015 5/5/2015
5/1/2015 5/5/2015
5/1/2015 5/5/2015
5/1/2015 5/13/2015
5/1/2015 5/5/2015
5/1/2015 5/5/2015

or

Entry Date 5/1/15:

Date Of Svc Date Of Entry
4/29/2015 5/1/2015
5/1/2015 5/1/2015
4/27/2015 5/1/2015
4/29/2015 5/1/2015
4/29/2015 5/1/2015

I've set up two static parameters for the selection process and attempted to drive the selection by writing the record selection formula as follows: ({PatientVisit.Entered} = {?EntryDate} or {PatientVisitProcs.DateOfServiceFrom} = {?DateofService}) however this does not work. I also tried using a default value in the parameter however this did not work either as my parameter is set up to allow ranges. The intent is to prevent the end user from utilizing both parameters in the same report. In essence if DOS is entered than the Entry Date is to be ALL and if the Entry date is entered than the DOS is to be ALL. I've also tried creating a Command Table to capture the dates, however every time I add a Command Table my reports fail.

Your assistance is appreciated.
 
There is no way to prevent the user from entering both dates. However, you could do something like this:

1. Add a parameter where the user selects the specific date to use - DOS or Entry.
2. Use a single date parameter.
3. In the Select Expert, you'll do something like this (the parentheses are important!):

(
({?Date Type} = 'DOS' and {MyTable.DOS} in {?Date Range}) or
({?Date Type} = 'Entry' and {MyTable.EntryDate} in {?Date Range})
)

-Dell

DecisionFirst Technologies - Seven-time SAP BusinessObjects Solution Partner of the Year
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top