Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Different Start/End of Date Range Parameter Defaults

Status
Not open for further replies.

bjplayer

Programmer
May 14, 2002
11
US
Using CR 8.5:

I have created a Date Range Parameter. I want to have two different dates be the default for the Start and End of Range, but I don't know how to do this in the Set Default Values screen. It seems I can only have one date be both the default Start and the default End of Date Range. I would also like to know how to set the Default Start be "No Lower Bound," and the default End be today's date, so the user doesn't have to check the "No Lower Bound" checkbox at runtime.

Thanks.
 
Dear BJPlayer,

I can find no options within Crystal that allow you to set the default dates as you indicated for a range and the lower and upper bound within Crystal. This may be something that you can do through the RDC, I don't know?

Also, I am slightly confused as to what you are trying to accomplish.

If you set no default values - the default for both start of range and end of range will be today.

The set no lower bound creates a range with no start date -- so you are effectively selecting records that are equal to(if you include value) or less than the selected date.

For example, I created a parameter as you described. Set no lower bound and here is what is passed to SQL (include value was selected):

Support_Staff.&quot;LastModified&quot; < {ts '2002-09-04 00:00:00.00'}

Is this what you intend? If that is the case, why not make it easy on yourself and create a discrete date parameter and simply change the select statement to be Less than Date? By not setting a default value - it will always default to today.



Hope that was helpful,

ro

Rosemary Lieberman
rosemary@microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.
 
I had a feeling there was no way to do what I wanted. I would have liked to set defaults for the range as described, but still allow the user to change these range defaults. A discrete value would thus not suffice in all cases.

By the way, today is 09/03/02. Hope your computer clock is not wrong!

Thanks, Rosemary.
 
Dear BJPlayer,

FYI

Since I said include value for today and my field is a date-timestamp Crystal makes the date tomorrow at 12:00 am so that everything dated 9/3 11:59:59 or less would be included!

ro Rosemary Lieberman
rosemary@microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top