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

Date ranges

Status
Not open for further replies.

Cpreston

MIS
Mar 4, 2015
972
GB
Hi

We have a report (designed some time ago by someone else) which I need to change.

I have found in the header it is using date ranges as below

disparamDateRangeFrom
//Name Date
//Prompt Please select an order date range (optional):
//InputType 7
//Choices
//DefaultValue
//Multiselect FALSE
//Required FALSE
//Range disparamDateRangeTo
//Sequence 1
""

disparamDateRangeTo
// This text will be replaced at runtime
""

And the header formula looks like this
If {@disparamDateRangeFrom} <> "" Then
if {@disparamDateRangeFrom} <> {@disparamDateRangeTo} Then
rephead := "From " + totext(DateValue({@disparamDateRangeFrom}))
Else rephead := "Order Date " + totext(DateValue({@disparamDateRangeFrom}))
Else
rephead := "From earliest date ";

If {@disparamDateRangeTo} <> "" Then
if {@disparamDateRangeFrom} <> {@disparamDateRangeTo} Then
rephead := rephead + " to " + totext(DateValue({@disparamDateRangeTo})) + ";"
Else rephead := rephead + ";"
Else
rephead := rephead + " To latest date; ";

rephead := rephead + " All branches; ";


I cannot work out how it is selecting the dates from our database? Secondly I want it to only look at yesterdays date and Fridays date on a Monday (Friday before the Monday) and ignore weekend dates.

Any ideas on what the code is doing and also how to change to my requirements.

many Thanks
 
It looks like someone created formulas for the begin and end dates.

{@disparamDateRangeFrom} should look something like MINIMUM){?Date Range})

YOur record select formula should look something like:
{table.OrderDate} in {?DateRange}
 
OR the record select formula should look like:

{table.OrderDate} in {@disparamDateRangeFrom} to {@disparamDateRangeTo}


FireGeek
(currently using Crystal Reports XI with Lawson 9.01)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top