cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass month name as parameter to crystal report

Former Member
0 Kudos

Hi All,

I am making a report where I have to show records by month, I used a drop down list with the names of months and another with a list of Years.

How can I pass the the name of month and the year as parameters to the report so that the report of that month & year can be viewed... If I select january and 2013 then I should be able to view records of jan,2013 in my report.

Thanks and Kind Regards,

Mohit

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

  U pass month index value (x1) to report. In report date field u can use month(date)=x1 to filter particular month value. you can also add year validation (year(date)=x2).

Regards,

Venki ,A

Former Member
0 Kudos

Hi Mohit,

Hope, you've not hardcoded the values on the Month and Year drop down. This will not take care of any dynamic changes at the backend. A better approach could be to create a Date table in the database and have the year-month information stored in separate columns OR if you can create a semantic layer i.e Business View or a Universe then you can create an LOV or a custom dimension respectively.

-Prathamesh

abhilash_kumar
Active Contributor
0 Kudos

Hi Mohit,

Go to the Record Selection Formula (Report > Selection Formulas > Record) and use this code:

monthname(month({Date_field_from_database})) = {?Month} AND

Year({Date_field_from_database}) = {?Year}

where {?Month} is the Month parameter and {?Year} is the Year parameter you created.

-Abhilash