cancel
Showing results for 
Search instead for 
Did you mean: 

Creating Date Range Parameters

Former Member
0 Kudos

Hi,

I have created the date range parameter using the parameter fields, but when I refresh the report the data does not get affected. It gives the same result as it would have given without the date parameter. What needs to be done in order for the parameter to actually work.?

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Did you add your date range parameters to the record selection formula?

Don

Former Member
0 Kudos

How to do that, by creating a formula in the formula field and then how to link it? OR is there another method to do that..?

Thanks

Nimit

Former Member
0 Kudos

By adding a parameter you just defined a variable/ condition. Now when you want to display your results based on the values selected, you mean to implement a condition , similar to where clause in usual queries.

For this we use the record selection formula, meaning to say the records would be selected based on those conditions.

For eg. You are using the date range and you want to display data falling within those date range. That is you need to create a condition :

1. What condition u2013 you have already created the parameters

2. Implement that in where clause u2013 you need to create a record selection formula (menu Report -> Selection Formulas -> Record )

You may probably need to use something like : in {?DateFrom} to {?DateTo}

Former Member
0 Kudos

Thanks Sujata,

I know the steps of how to go to the where clause, but the only thing I did'nt know is the syntax for the Where clause required for validating the date parameters, I tried using some formula's but when I tried to save it threw an error prompting 'Error in the formula field'. If you know any resources where can I get to learn how to create a where clause in the crystal reports would be really very helpful.

Thanks again

Edited by: wizzard001 on Jun 14, 2011 5:12 PM

0 Kudos

You can't edit the WHERE clause in CR Designer, it gets generated when you create a record selection formula. And as long as CR can pass the formula fields to the SQL directly it should be there when you Show SQL. If you don't see it then the parameters are not formatted in a way CR can add it directly to the SQL.

To see this add a record selection formula off of one of your number fields. Example: = 1234.

You should see that in the SHOW SQL. So when you add a date parameter if you don't see it then CR can't interpret the value you are passing.

Thank you

Don

Answers (0)