Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Date Range Post Reply Post New Topic
Author Message
brande87
Newbie
Newbie
Avatar

Joined: 01 Nov 2010
Location: United States
Online Status: Offline
Posts: 2
Quote brande87 Replybullet Topic: Date Range
     Posted: 01 Nov 2010 at 1:03pm
I'm very new to Crystal and am having a problem understanding creating a formula for date ranges.

I have a report that brings over all the issues for a particular project. This report will be a sub-report in an existing report. I want the sub-report to only show the last two weeks worth of data based on the report creation date.

Where do I begin? I have tried using the formula workshop and I just can't seem to get anything to work.

Thanks in advance!
IP IP Logged
rvink
Groupie
Groupie
Avatar

Joined: 04 Feb 2008
Location: New Zealand
Online Status: Offline
Posts: 55
Quote rvink Replybullet Posted: 01 Nov 2010 at 1:37pm
Try putting something like this into your select expert:

{table.datefield} >= CurrentDate-14 and
{table.datefield} <= CurrentDate


CurrentDate returns the present date. Subracting 14 takes off 14 days (two weeks). You'll need to figure out whether you need ">=" or just ">" etc to get the date boundaries right. Good luck.
IP IP Logged
brande87
Newbie
Newbie
Avatar

Joined: 01 Nov 2010
Location: United States
Online Status: Offline
Posts: 2
Quote brande87 Replybullet Posted: 02 Nov 2010 at 9:10am
Thank you so much!!! Works like a charm.
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