cancel
Showing results for 
Search instead for 
Did you mean: 

Date range parameter in Crystal Report

Former Member
0 Kudos

I am trying to use the date range parameter for my report.

1) Create a parameter and named it "DateRange".

2) Select 'Date' in date option.

3) In 'Value Options:' I selected 'Allow range values' to true.

4) In 'report-> select expert -> record clicked on <New> tab and select the filed {test.date}

5) Choose 'is equal to' drop down list and set it to 'is equal to'

6) The drop down list next to step 4,  tried to select {?DateRange} but is missing.

Note: The field {test.date} is in YYYY-MM format like 2104-11.

I would appreciate if you can help me.

-Bill

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member184146
Active Contributor
0 Kudos

Hi,

     See the below screen shot

In above screen there is option Allow range values it depends on You either you want to give range in one parameter or you are creating the 2nd paramter for ToDate

also check the below screen how i created this From Parameter

Regards,

Manish

Former Member
0 Kudos

Hi Manish,

If you see my two images, the first image is exactly follow yours. My problem is the {?DateRange} is not shown in drop down list in my second image. I am not using SQL in order to create Command Parameter.

-Bill

Former Member
0 Kudos

Hi,

YOU CAN DROPDOWN THE VALUES LIST YOU CAN FIND THIS in last: {?DateRange}

--dj

former_member184146
Active Contributor
0 Kudos

Hi,

     Make the discreate value true instead of false.

Regards,

Manish

Former Member
0 Kudos

Hi DJ,

The value is always listed at the top and is missing.

-Bill

Former Member
0 Kudos

Hi Manish,

Not working.

-Bill

Former Member
0 Kudos

Hi Bill,

Instead of seraching for date parmeter field why can't you create the record selection formula like this after OACT segment filter

{date}={?Dateparameter}

former_member184146
Active Contributor
0 Kudos

Hi Bill,

          What is the Test in Test.date is it a aliase of a OJDT or other table. can you give me the Team viewer?? so that we both can look the issue on your crystal.

Regards,

Manish

Former Member
0 Kudos

Hi Manish,


That was just an example using Test.Date. The Actual table i am using is OFPR table.


-Bill

former_member184146
Active Contributor
0 Kudos

Bill,

     Now try this

1. Make a new Parameter same as you see in below screen

2. Now Go to Select expert and select new> OFPR.date and click on formula editor and type it manualy see thee screen shot below

Now save the formula and it should work now.

Regards,

Manish

Former Member
0 Kudos

Hi Manish,

Thanks for help. I have a hard time to read the second image formula.

-Bill

former_member184146
Active Contributor
0 Kudos

Hi,

     This was the formula

{Command.U_ProductGroup} = {?Select Product } and

{Command.ItemCode} = {?ITEMCODE @SELECT ItemCode,ItemName FROM OITM  WHERE U_ProductGroup<>''}

and

{OFPR.Date} in {?Date3}

see you have to add the last line manually.

Regards,

Manish

Former Member
0 Kudos

Hi Manish,

why did you select OITM table? .... I am completely confused with these formula.

-Bill

former_member184146
Active Contributor
0 Kudos

Hi Bill,

     That was the example ony dont get confuse with that you have to add the last line e.g

{OFPR.Date} in {?Date3} in the formula


Rgards,

Manish

Former Member
0 Kudos

Thanks Manish for your time and help. I keep this thread open until to get help.

-Bill

former_member184146
Active Contributor
0 Kudos

Most welcome Bill, we all are here to help each other, nop.

Regards,

Manish

former_member184146
Active Contributor
0 Kudos

Hi,

   Can you post the screen shot of your parameter in edting mode.

Regards,

Manish

Former Member
0 Kudos

please see the attached screenshot.

Former Member
0 Kudos

Hi Bill,

Check the datatype of your data parameter here.

Edit parameter->type 

.It should be same as your date field datatype

Former Member
0 Kudos

Hi Vissu,

I used Date for my data parameter. Still is not working.

-Bill

Former Member
0 Kudos

Hi,

I just checked your 4th point do this way:

4) In 'report-> select expert -> record > select {test.date} > ok > Open new window after you can select 'is equal to' then click values list i.e {?DateRange} > ok.

Please confirm and update parameters & checked ..

Thanks,

DJ

Former Member
0 Kudos

Hi DJ,

But it did not work.

-Bill

Former Member
0 Kudos

Hi Bill,


Can you try other way to create data range parameters like this.

1.Create a parameter named fromdate and select your datefield.

2.Ceate 2nd parameter todate and select your datefield.

3.Goto record selection formula write like this.

{Date} in {?Fromdate} to {?ToDate}

Former Member
0 Kudos

Hi,

See this: 

--DJ