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

Default Parameter

Status
Not open for further replies.

trafficstudent

Programmer
Oct 21, 2005
106
US
How can I display a just the full month names and not the month and dates. I'll im looking for in my parameter dropdown is for the (months names) January and if the user selects that month to say July then all information will be return in the CR9 report.
 
Use the monthnumber as the value, and the month name as the description field, and then choose to display only the description field.

-LB
 
LB, I saw that option in the parameter field, however when i setup the description to display i still get the calendar option? When i check the parameter settings i see that the display option is still set to display the description.
The report writer im working in is CR.
 
The parameter should be set up as a number parameter, not a date parameter. Enter the month number as the value, and the month name as the description. Then set the display to "Prompt with Description Only". Allow range values, and do not allow custom values. Then users will be able to choose ranges like Jan to Apr, etc. Your record selection formula should probably be set up using a SQL expression {%month}:

month(table.`date`)

Or use the SQL expression function in the dropdown list:

{fn month(table.`date`)}

Then use a record selection formula like:

{%month} = {?monthrange}

Note that you would also need to use a year selection unless you want to show values across years with the same months or unless your record selection already defines only one year.

-LB
 
LB- I dont underrstand what you mean by the above post. When i setup my parameter, I need to select the paramter type as date or date time in order for my table field to be available.

"Enter the month number as the value, and the month name as the description". - I dont understand what is meant on this
line.

month(table.`date`)
Or use the SQL expression function in the dropdown list:
{fn month(table.`date`)}
Then use a record selection formula like:
{%month} = {?monthrange}

Were do i put this SQL statement?

Thanks I hope you can point me on the right track.
 
As I understand it, you want the user to select a month and data to be returned for that month. I was suggesting the following:

Create a month parameter {?month} which is of number datatype. For the value, enter the numbers 1 to 12, and in the description area, enter the corresponding monthnames. Then choose to display the monthname only for the parameter list of values.

I would also create a year parameter, again of number value, so that data from multiple years is not combined. Then in your record selection area, you can use:

month({table.date}) = {?month} and
year({table.date}) = {?year}

To make the report faster, you could create the following two SQL expressions in the field explorer->SQL expression->new:

[%month:]
{fn month(table.`date`)}

[%year:]
{fn year(table.`date`)}

Then you could change your record selection formula to:

{%month} = {?month} and
{%year} = {?year}

...but either record selection approach will work.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top