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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Options for Mandatory Date Parameters

Status
Not open for further replies.

tekniks

Technical User
Jun 27, 2003
98
US
Hi,

I am using CR 8.5 with CE 8.0. When using the default Date parameter in CR, it becomes mandatory to insert the dates before running the report thro' the web using CE.

Somehow the users hate to key in the date when they don't know the dates. Therefore, we would like to make the date parameter Optional(format: 18MAR2004).

Just wanted to gather views and ideas around about what could be the best option to handle this situation.

Thanks

An early response would be appreciated.

TEK
 
Hello,
I need this answering too, please...
I have standard flexible reports that ask the user for financial "As at Date" figures. I have recently upgraded from CRv8.5 to CRv10 with CEv10 running on SQL 2000 and need to 'schedule' these standard reports to run daily or weekly and need to handle a default 'currentdate' or 'datadate' (Datadate - preference for history instances) in the program. I have tried the following formula:

Formula = {@As at Date}:
>> if isnull({?As At Date}) then Datadate else {?As At Date}

but the scheduller will not run without entering a {?As at Date}. This date needs to change automatically each day. What can I do?
 
Try this:
Create a parameter with a default value of none
Then create this formula

if isdate({?As of Date Filter}) then
cdate({?As of Date Filter})
else if {?As of Date Filter}='NONE' then
(CurrentDate)
 
Not sure what you're saying, but my approach to parameterized dates in CE 8.5 is to preload the default value for the date with some known impossible value (such as 1/1/1970), and then if the users don't enter anything, derive a date.

Also place a description for the date such as the word Default, and then change the "Display:" section from Value and Description to just Description.

Now in the Report->Edit Selection Formula->Record use soemthing like:

(
if {?MyDateParm} <> cdate(1970,1,1) then
{table.field} = {?MyDateParm}
else
<whatever you need>
)

Gives a clean appearance and a friendly experience for the user.

-k
 
Hi,
I needed to schedule a report that has a date parameter. In order to do that, I removed the parameter from the report and created the following formulas.
The report is scheduled to run daily at 7.00 am and print transactions from 6.30 am previous day until 7.00 am current day (or running day)

@StartDataDate
DateAdd('n', -1470, DateTimeValue(DataDate, DataTime))

@EndDataDate
DateTimeValue(DataDate, DataTime)

@RecordSelection
table.datefield >= @StartDataDate
and
table.datefield < @EndDataDate

I hope this help,

Dana
 
Sorry for the delay in responding tou your solutions (been away). Thanks for your 3 solutions to my problem. I have gone with synapsevampire's and it works perfectly. Will save the others as I am sure they will prove useful. Many thanks again. Still feel that BO should give a slicker method though.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top