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 PARAMETERS

Status
Not open for further replies.

saradaga

Programmer
Jul 10, 2008
22
US
Hi,
I have 2 parameters START DATE and END DATE. I want to default the START DATE to 1st day of previous month and default the END DATE to last calender day of previous month.

Any suggessions pleasee.

Thanks.
 
Generally Date Params default to current date.

Thus you can have one param and two formula.

@Startdate

date(year(dateadd("m", -1, {?dateparam}), month(dateadd("m", -1, {?dateparam}), 01)

@EndDate
date(year({?dateparam}), month({?dateparam}), 01)-1

Of course for these formula you do not really need a param and can just use the Crystal function currentdate instead.

Use these formula in select and display on report. Crystal will calculate and pass to database.

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top