Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Default start and end for a range parameter. Post Reply Post New Topic
Page  of 2 Next >>
Author Message
Erinmichelle
Newbie
Newbie
Avatar

Joined: 06 Nov 2009
Location: United States
Online Status: Offline
Posts: 24
Quote Erinmichelle Replybullet Topic: Default start and end for a range parameter.
    Posted: 06 Nov 2009 at 10:19am
I have a time range parameter but I want to set defaults to be starting at 00:00:00 and ending at 23:59:59 - our users usually skip over this parameter which is set to start at 00:00:00 and end at 00:00:00 - of course, this returns no data!  Any help with this one?
Thanks!

Erin
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 06 Nov 2009 at 10:33am

With Crystal XI and up I know that you can set a default value when setting up parameters.  For an older version, you might be able to use a formula and check for a null value from the parameter (I have not tried this).



Edited by kevlray - 06 Nov 2009 at 10:33am
IP IP Logged
Erinmichelle
Newbie
Newbie
Avatar

Joined: 06 Nov 2009
Location: United States
Online Status: Offline
Posts: 24
Quote Erinmichelle Replybullet Posted: 06 Nov 2009 at 10:35am
Thank you for your reply!
I do have Crystal XI but it only lets me set one default - so that makes it the default for both the beginning and the end of the range which isn't really helpful for what I'm trying to do. Is there any way to enter both a default value for start time of the range and default value for end time of the range??
Thanks!

Erin
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 06 Nov 2009 at 10:43am
I think you would have resort to a formula and look at the min and max values.  I know other people in the office have done similiar formula, but do not think they ever did anything with a range value.
 
Lots of luck.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 06 Nov 2009 at 10:45am

Another approach would be to use an OR statement to ignore that filter if both values are 00. Assuming you have 2 distinct params it would be something like:

(({?My Parameter1}=time(00,00,00) and {?My Parameter2}=time(00,00,00))
or
(time({table.time}) in {?My Parameter1} to {?My Parameter2}))
IP IP Logged
Erinmichelle
Newbie
Newbie
Avatar

Joined: 06 Nov 2009
Location: United States
Online Status: Offline
Posts: 24
Quote Erinmichelle Replybullet Posted: 06 Nov 2009 at 10:45am
Thanks Kevlray!  I will play around with that. 
 
If anyone else has any suggestions I would also appreciate it in case I can't figure this one out.
 
Thanks!
Thanks!

Erin
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 06 Nov 2009 at 10:51am
Since you are using one para with min and max it would be something like this:
((minimum({?Time})=time(00,00,00) and maximum({?Time})=time(00,00,00))
or
(time({table.timefield}) in minimum({?Time}) to maximum({?Time})))
IP IP Logged
Erinmichelle
Newbie
Newbie
Avatar

Joined: 06 Nov 2009
Location: United States
Online Status: Offline
Posts: 24
Quote Erinmichelle Replybullet Posted: 06 Nov 2009 at 2:29pm

Thank you for your help! I'm am still trying to play around with it but I think I'm on the right track.

Thanks!

Erin
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 06 Nov 2009 at 2:32pm
what is not working?
IP IP Logged
Erinmichelle
Newbie
Newbie
Avatar

Joined: 06 Nov 2009
Location: United States
Online Status: Offline
Posts: 24
Quote Erinmichelle Replybullet Posted: 06 Nov 2009 at 2:35pm

This is what I tried to do as you suggested in the select expert.  Basically, if the user leaves the time range to be 00:00:00 to 00:00:00 instead of changing the end range to 23:59:59 or a different time, then I want it to just select all of the data.  But I still get nothing.

(((minimum({?timeRange})=time(00,00,00) and maximum({?timeRange})=time(23,59,59))
or

({@time}) in minimum({?timeRange}) to maximum({?timeRange})))

Thanks!

Erin
IP IP Logged
Page  of 2 Next >>
Post Reply Post New Topic
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



This page was generated in 0.031 seconds.