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

Start date parameter

Status
Not open for further replies.

mart10

MIS
Nov 2, 2007
394
GB
I am using CRW 10

I want start and end dates on parameter. I want 2 things:

start date cannot be allowed before 1/10/2011.
end date can be any date other than before start date

how do i do this please?
 
So is 1/10/2011 January 10 or October 1?

What have you tried and what problems have you run into?

-LB
 
sorry it 1st october 2011. I havent tried anything yet I just wondered if there was a standard method to approach this becasue in fact it is quite a common thing i have come accross. I cant hard code the start date as 01/10/2011 because they may want to pick a period say 01/11/2011 to 31/12/2011. All I want to do is to never allow the start date to be less than 01/10/2011 and then also allways test that end date is never less than start date
 
You could control it by formula fields that replace invalid values, e.g
Code:
if @StartDate < Date(2011, 10, 1)
then Date(2011, 10, 1)
else @StartDate
Code:
if @EndDate < @ActualStartDate
then @ActualStartDate
else @EndDate
Also create report header sections that will do the same tests are draw attention to an error if it occurs.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
You could use a record selection formula like this:

{?Start} >= date(2011,10,1) and
{table.date} >= {?Start} and
{table.date} < {?End}+1

This will return no records if the {?Start} is earlier.

Another solution would be to set up an alert (Report->Alerts) in the report so that a message pops up whenever the {?Start} is earlier than your criterion.

-LB

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top