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!

Default value for Date parameter aginst stored procedure

Status
Not open for further replies.

goranm

Programmer
Dec 18, 2001
247
SE
Hi !

We have CR 9 and Crystal Enterprise 9.

We now have two reports against an SQL Server database.

There they have written a stored procedure, which I use
in my reports.

The procedure takes two parameters:
@FromDate and @ToDate (both DateTime).

My problem is that I want to schedule the reports in Enterprise
to run weekly and monthly.

What can I do to get the two parameters to always content the last monday (@FromDate) and
the last sunday (@ToDate) for the weekly report, and first and last date of the previous
month for the monthly report ?

Thanks.

/Goran
 
Speak with hte "they" that generated the SP, since the parameters are in the SP, the logic should be in there.

As for how this might be done, it depends on what you really want. For instance, why have date parameters if all you want is the last week or last month, and an adjusted version of each.

At least have them create an additional parameter which accepts "Last Week" or "Last Month" and figures out the dates.

Were they to have created a View instead of an SP, then you could have used Crystal to figure out the dates and pass them as SQL to the database, now you'd want database programming.

-k
 
Thanks !

Well I tried from the beginning to have them to create a View instead of an SP, but they insisted and said that there were things that had to be done in SP.

I will talk to them tomorrow and try to have them to change/add the parameter like you suggested.

/Goran
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top