Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Formula help Post Reply Post New Topic
Author Message
Pamela
Newbie
Newbie
Avatar

Joined: 04 Apr 2013
Location: United States
Online Status: Offline
Posts: 5
Quote Pamela Replybullet Topic: Formula help
     Posted: 04 Apr 2013 at 8:32am
I need help creating a formula that will limit a sub-report date range.  The main report has date parameters set to pull crime data for a specific "from time" and "To time"  based on a date field in the crime reports.  I need the sub report  formula to show "year to date" from jan 1 of the current year and to end with the "to date" parameter in the main report. 
 
I can set it to give me year to date, no problem.  but it pulls all data right up to the time the report is run.  I need it to stop at a past date based on main report parameters. 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 04 Apr 2013 at 10:30am
in the sub report set a link up and use the ?to date param as teh source of the link
in the sub report use this newly created param (from the link) in the select expert
 
table.date in date(year(currentdate),1,1) to {?pm-to date}
IP IP Logged
Pamela
Newbie
Newbie
Avatar

Joined: 04 Apr 2013
Location: United States
Online Status: Offline
Posts: 5
Quote Pamela Replybullet Posted: 05 Apr 2013 at 3:35am
Thanks so much!  it worked perfectly.
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