Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Date Parameter with Range Post Reply Post New Topic
Author Message
Kerkuk
Newbie
Newbie


Joined: 08 Dec 2011
Online Status: Offline
Posts: 22
Quote Kerkuk Replybullet Topic: Date Parameter with Range
     Posted: 10 Feb 2012 at 6:08am
I have a date parameter with range from - to , when I place the parameter in the report i see blank parameter.I need to show (for eaxmple (From 1/1/2007 to 12/31/2007)
IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 10 Feb 2012 at 8:34am
try using two parameters
begin date
end date

then create a text box place them into it
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 10 Feb 2012 at 11:50am
I've been mulling this one over...
 
I am pretty sure that Brian covers it in his book, I just don't have it handy.
 
If it is one parameter and it holds 2 values you would need to access the array that is behind the parameter.  A formula like:
 
 totext({?parameter}[1], "MM/dd/yyyy") + " - " + totext({?parameter}[2], "MM/dd/yyyy")
 
should work
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 13 Feb 2012 at 3:41am
I have found that minimum and maximum work for a date range parameter well.
you can either create two formula fields to drag and drop where you want
minimum({?date})
maximum({?date})
 
or you could follow lockwelles suggestion
 
totext(minimum({?date}), "MM/dd/yyyy") + " - " + totext(maximum({?date}), "MM/dd/yyyy")
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 13 Feb 2012 at 5:44am
doh...
 
the classic answer is actuall min and max for a date range, but for some reason I got caught up in how to determine the array values.
 
Actually min and max will work better because if the user enters them in reverse order, they should still work.
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