Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Date Range Help Post Reply Post New Topic
Author Message
jpsstar
Newbie
Newbie


Joined: 18 Aug 2011
Location: United States
Online Status: Offline
Posts: 4
Quote jpsstar Replybullet Topic: Date Range Help
     Posted: 12 Oct 2011 at 9:08am
Hi all looking for help on a date range.

I want the user to plug in a date range, say 10/01/2011 to 10/10/2011, and have all orders made in that date range returned.

Could someone please walk me through how to set this up?

Thank you.

IP IP Logged
cmpgeek
Newbie
Newbie
Avatar

Joined: 11 Dec 2007
Online Status: Offline
Posts: 39
Quote cmpgeek Replybullet Posted: 12 Oct 2011 at 9:39am
The way I have to do it now consists of 2 parameters & looks like this:
{order.date} in {?Start Date} to {?Stop Date}
If you are able to create an actual date range parameter you could set it up like this:
{order.date} in {?daterange}
 
hth,


Edited by cmpgeek - 12 Oct 2011 at 9:40am
Nomi   
CR 10    
Oracle 9i
IP IP Logged
jpsstar
Newbie
Newbie


Joined: 18 Aug 2011
Location: United States
Online Status: Offline
Posts: 4
Quote jpsstar Replybullet Posted: 13 Oct 2011 at 3:35am
I've entered:
{order.date} in {?Start Date} to {?Stop Date}
When I enter the parameters as prompted (ie 20111001 / 20111016) no orders are returned.
 
If I manually put:
{order.date} in "20111001" to "20111016"
Then orders in that date range are returned.
IP IP Logged
cmpgeek
Newbie
Newbie
Avatar

Joined: 11 Dec 2007
Online Status: Offline
Posts: 39
Quote cmpgeek Replybullet Posted: 13 Oct 2011 at 3:55am
I am guessing that your field {order.date} is not formatted as an actual date.  If you change the {?Start Date} & {?Stop Date} parameters to be formatted as numbers instead of dates I think that will solve the problem.
hth,
Nomi   
CR 10    
Oracle 9i
IP IP Logged
FrnhtGLI
Senior Member
Senior Member
Avatar

Joined: 22 May 2009
Online Status: Offline
Posts: 347
Quote FrnhtGLI Replybullet Posted: 13 Oct 2011 at 3:57am
You could also try:

{order.date}>={?Start Date}
and
{order.date}<={?Stop Date}
|< /\ '][' ( )
IP IP Logged
jpsstar
Newbie
Newbie


Joined: 18 Aug 2011
Location: United States
Online Status: Offline
Posts: 4
Quote jpsstar Replybullet Posted: 13 Oct 2011 at 4:03am
Apparently it is formatted as a string.  Confused
 
Is there a way I can have the user input a date parameter and then change it to the appropriate string for selection?
 
Thanks for the help everyone.
IP IP Logged
cmpgeek
Newbie
Newbie
Avatar

Joined: 11 Dec 2007
Online Status: Offline
Posts: 39
Quote cmpgeek Replybullet Posted: 13 Oct 2011 at 4:21am

Try this:

Change the {?Start Date} & {?Stop Date} to string parameters.  Then put the following as the default value for each of them:  yyyymmdd   and set the min & max length both to 8. 
 
The default value will tell the end user the format it needs to be in and limiting the length will keep them from trying to add the "/"...
 
hth,
Nomi   
CR 10    
Oracle 9i
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 13 Oct 2011 at 6:14am
or use date type params and convert your field into a date type
 
date(right({order.date},2)+'/'+mid({order.date},5,2)+'/'+left({order.date},4))  in {?Start Date} to {?Stop Date}
 
IP IP Logged
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