Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Parameter Post Reply Post New Topic
Page  of 2 Next >>
Author Message
south
Groupie
Groupie


Joined: 31 Jul 2012
Online Status: Offline
Posts: 82
Quote south Replybullet Topic: Parameter
     Posted: 21 May 2013 at 5:18am
I have a report that has a ship date parameter.  This parameter allows the user to enter a ship date range.  I want my report to also include all orders that were due within that date range even if they didn't ship.  I tried using the due date as the parameter but then it won't list the orders that shipped even though they were not due.  I wanted to add a second parameter one for ship date and one for due date but I dont want the user to have to enter the same date range twice.  It seems so easy yet I am drawing a blank.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 21 May 2013 at 5:36am
please explain your data set more. maybe a few sample rows and how you want it to function for these rows.
IP IP Logged
south
Groupie
Groupie


Joined: 31 Jul 2012
Online Status: Offline
Posts: 82
Quote south Replybullet Posted: 21 May 2013 at 6:03am
my report currently looks like this
customer - delivery due date - ship date - ship qty
    abc co -       5/21/13        -5/21/13  -    1
I have a parameter in the report that uses the ship date field to enter a date range, it works fine except now my boss wants me to list customers with delivery due dates that are within the date range entered even if they did not ship, so the report would look like this:
customer - delivery due date - ship date - ship qty
    abc co -       5/21/13        -5/21/13  -    1
    xyz co -       5/21/3          -     0        -    0
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 21 May 2013 at 6:07am
table.shipdate in {?start} to {?end}
or
table.deliveryduedate in {?start} to {?end}
IP IP Logged
south
Groupie
Groupie


Joined: 31 Jul 2012
Online Status: Offline
Posts: 82
Quote south Replybullet Posted: 21 May 2013 at 6:55am
I tried using the formula you listed but it didn't work.  My report will only list shipped date for the date range entered.  I know this is because my parameter uses the ship_date.  is there a way to set up a parameter for the due date and tell it to use the date range entered for the ship date?  I don't a user of my report to have to enter a start and end date for both ship and due date. 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 21 May 2013 at 6:59am
what do you mean the 'parameter uses the ship_date'?
do you mean it is a dynamic parameter?
IP IP Logged
aarti
Newbie
Newbie


Joined: 25 Aug 2011
Online Status: Offline
Posts: 17
Quote aarti Replybullet Posted: 21 May 2013 at 7:15am
Hi,
Try below one:

If (isnull(table.shipdate) or table.shipdate ="") then
    table.deliveryduedate >= {?start} and
    table.deliveryduedate <= {?end}
else
    table.shipdate >= {?start} and
    table.shipdate <= {?end}

IP IP Logged
south
Groupie
Groupie


Joined: 31 Jul 2012
Online Status: Offline
Posts: 82
Quote south Replybullet Posted: 21 May 2013 at 7:34am
I meant that in the select expert/record/ i set the {ship_date}={?DateRange}
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 21 May 2013 at 7:39am
is date range paramter set to allow for a range or do you intend for it to only match one day?
 
aarti is likely accurate that a null may be causing it to stop evaluation but that is a partial fix and can be handled a few ways.
I also do not recommend using if-then statement as select statements.
 
if you want a date range
in the select formula, set it to 'use default values for Nulls'
chaneg your select statement to go for a range
 
{ship_date} in Minimum({?DateRange}) to Maximum({?DateRange})
or
{Delivery_Due_date} in Minimum({?DateRange}) to Maximum({?DateRange})
IP IP Logged
south
Groupie
Groupie


Joined: 31 Jul 2012
Online Status: Offline
Posts: 82
Quote south Replybullet Posted: 21 May 2013 at 7:57am
When I try to save the formula it says that {?DateRange} cannot be summerized.
IP IP Logged
Page  of 2 Next >>
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum