Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Paramete:DateRange Limits Post Reply Post New Topic
Author Message
jybeard
Newbie
Newbie


Joined: 27 Jul 2010
Location: United States
Online Status: Offline
Posts: 3
Quote jybeard Replybullet Topic: Paramete:DateRange Limits
     Posted: 27 Jul 2010 at 2:14pm
Hi,
 
I'm trying to limit my Date Range parameter to 1 month increments.  Does anyone know how to do this? 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 27 Jul 2010 at 4:11pm
it is probably much easier to use the select expert to make a month of data returned out of a single date parameter.
What exactly do you want your report to return and what option do you wnat to give your end users?


Edited by DBlank - 27 Jul 2010 at 4:12pm
IP IP Logged
jybeard
Newbie
Newbie


Joined: 27 Jul 2010
Location: United States
Online Status: Offline
Posts: 3
Quote jybeard Replybullet Posted: 27 Jul 2010 at 6:47pm
I'm uploading this report to a medical application that allows the end users to view the report with the parameters as filters. This system is being used by a lot of users statewide. I want to limit the bandwidth on the system. I need to limit their reports to monthly pulls rather than letting them pull a years worth of data.
IP IP Logged
abhashkr
Newbie
Newbie
Avatar

Joined: 24 Apr 2007
Location: India
Online Status: Offline
Posts: 5
Quote abhashkr Replybullet Posted: 28 Jul 2010 at 1:44am
In report selection criteria, give the condition like:
if datediff("m",{InputDate},Datadate)<1 then
////
selection criteria.


////

and if you put 1 label about this information.

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 28 Jul 2010 at 3:37am
You can have them enter a date and your select statement can control the month from that.
If you want them to enter a start date you can use
datefield in {?dateparam} to dateadd('m',1,{?dateparam})
or back a month flip it
datefield in dateadd('m',-1,{?dateparam}) to {?dateparam}
or for the curernt month  selected
datefield in dateserial(year({?dateparam}),month({?dateparam}),1) to dateserial dateserial(year({?dateparam}),month({?dateparam})+1,1-1)
 
This being said, if you can you are likely much better off using a stored proc with its own date parameter and doing the record selection at that level. It is a more efficient process and limits your data retrieval better.
HTH
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum