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

Two Parameters for Surgery Date and Posted Datetime

Status
Not open for further replies.

Garyjr123

MIS
Sep 14, 2010
139
US
I'm writing a report where the end user would like to look at the data in two ways using two different parameters in the same report.
1) Using a surgery date parameter
2) Using a posted datetime parameter

Is this possible in CR XI? If so do I create separate parameters using the different {table.field} or can I create one parameter and within the selection editor have the two different {table.field} point to it.

Basically, the enduser wants the surgery date parameter to return results for the whole day and the posted datetime parameter to return results for a certain day after a certain time.
 
You could add a string parameter {?DateType} with options "Surgery" and "Posted". Then create a datetime parameter {?DateTime}. Your record selection formula could look like this:

(
(
{?DateType} = "Surgery" and
date({table.datetime}) = date({?DateTime})
) or
(
{?DateType} = "Posted" and
{table.datetime})>={?DateTime} and
date({table.datetime}) = date({?Datetime})
)
)

You could give prompt instructions like this for {?DateTime}:

"If you chose "Surgery," enter any datetime on the date of interest; if you chose "Posted," enter a datetime that is the beginning time for results on that day."

-LB
 
LB,

How would the above record selection formula look if both of the parameters need to be ranges? So a "Surgery" range and a "Posted" range instead of just entering one datetime for both?

Gary
 
LB,

I put this into the record selection and this message shows up //requires a boolean message (see below)>

(
(
{?DateType} = "Surgery" and
date({appt.start_datetime}) = date({?DateTime})
)
or
(
({?DateType} = "Posted" and
{appt.start_datetime)//requires a boolean message shows
>= {?DateTime} and
date({appt.start_datetime}) = date({?DateTime})
)
)

Gary
 
Your original post showed that you would be running the report for one day only, so that was what the formula was designed for. If you want a datetime range parameter, then how would that work across days? I'm not sure what time frames you would want returned if multiple dates were involved in the Posted scenario.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top