Author |
Message |
Erinmichelle
Newbie
Joined: 06 Nov 2009
Location: United States
Online Status: Offline
Posts: 24
|
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 Logged |
|
kevlray
Admin Group
Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
|
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 Logged |
|
Erinmichelle
Newbie
Joined: 06 Nov 2009
Location: United States
Online Status: Offline
Posts: 24
|
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 Logged |
|
kevlray
Admin Group
Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
|
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 Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
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 Logged |
|
Erinmichelle
Newbie
Joined: 06 Nov 2009
Location: United States
Online Status: Offline
Posts: 24
|
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 Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
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 Logged |
|
Erinmichelle
Newbie
Joined: 06 Nov 2009
Location: United States
Online Status: Offline
Posts: 24
|
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 Logged |
|
DBlank
Moderator
Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
|
Posted: 06 Nov 2009 at 2:32pm |
what is not working?
|
IP Logged |
|
Erinmichelle
Newbie
Joined: 06 Nov 2009
Location: United States
Online Status: Offline
Posts: 24
|
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 Logged |
|
|