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
<< Prev Page  of 2
Author Message
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:36pm
I also used this in the report footer which worked.  I tried to use a very similar formula in the select expert but kept getting errors that I haven't figured out yet.
 
IF(((Minimum({?timeRange})) = time(00,00,00)))AND (Maximum({?timeRange})) = time(00,00,00)
    then ""
else
"for the Time Period of " + ToText(Minimum({?timeRange})) + " to " + ToText(Maximum({?timeRange}))
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:43pm
Don't bother with the IF.
You had it on the other one but you just need to keep both the min AND max = 0,0,0... Since the user did not alter your default of 0 then it only has one value of 00:00:00. Therefore both the min and max in htis case are both the same, zero.
 
(
(minimum({?timeRange})=time(00,00,00) and maximum({?timeRange})=time(0,0,0))
or
({@time} in minimum({?timeRange}) to maximum({?timeRange}))
)


Edited by DBlank - 06 Nov 2009 at 2:43pm
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:48pm
That still didn't work... Here is the full select formula including that change. Maybe that has something to do with it:
 
{@Date} = {?dateRange} and
(
(minimum({?timeRange})=time(00,00,00) and maximum({?timeRange})=time(0,0,0))
or
({@time} in minimum({?timeRange}) to maximum({?timeRange})
))
 
and

not ({sp_rptdispSumm;1.pick_type_display} in ["Deleted", "User Deleted"])
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:52pm
Just to explain the first part
(minimum({?timeRange})=time(00,00,00) and maximum({?timeRange})=time(0,0,0))
is just a way to return a TRUE value in the select expert. Parenth it as you want both parts of it to be true. It won't even have to look at your data set and will return all rows.
The second part
({@time} in minimum({?timeRange}) to maximum({?timeRange}))
is to filter the way you want if a user actually put any value in the times.
 
You parenth the two togther in the OR statment so if part one is TRUE it skips part 2. if part one is FALSE it applies the filter in part 2.
Make sense?
Note that I have to credit Hilfy for showing this process to me.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 06 Nov 2009 at 2:55pm
gotta run out right now but I will look at this later.
In the mean time try each part seperately to see what is working for you and what is not.
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:56pm
Thank you so much for all your help, I was just doing that and I think it is starting to work!
Thanks!

Erin
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 09 Nov 2009 at 7:13am
Did you get this to work?
If not which part is the culprit?
IP IP Logged
Erinmichelle
Newbie
Newbie
Avatar

Joined: 06 Nov 2009
Location: United States
Online Status: Offline
Posts: 24
Quote Erinmichelle Replybullet Posted: 09 Nov 2009 at 7:14am
I did get it to work! Thanks!  Now of course, the daterange parameter in the select expert does not want to work at the same time....
Thanks!

Erin
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 09 Nov 2009 at 7:24am
if the below does not work what is the @date formula?
 
{@Date} in Minimum({?dateRange}) to Maximum({?dateRange})
and
(
(minimum({?timeRange})=time(00,00,00) and maximum({?timeRange})=time(0,0,0))
or
({@time} in minimum({?timeRange}) to maximum({?timeRange}))
)
IP IP Logged
Erinmichelle
Newbie
Newbie
Avatar

Joined: 06 Nov 2009
Location: United States
Online Status: Offline
Posts: 24
Quote Erinmichelle Replybullet Posted: 09 Nov 2009 at 8:07am
That worked! Thank you again for all of your help, I will store this information away for future use :)
Thanks!

Erin
IP IP Logged
<< Prev Page  of 2
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.