Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Single Record Reference from Range Post Reply Post New Topic
Author Message
npatel
Newbie
Newbie


Joined: 16 Dec 2010
Location: United States
Online Status: Offline
Posts: 20
Quote npatel Replybullet Topic: Single Record Reference from Range
     Posted: 25 Aug 2011 at 11:43am
I'm trying to reference a single field that fits a range criteria search. To better explain what I mean, I have a table that will tells me the applicable price for a certain date range:

Vendor | Start Date | End Date | Price |
ABC     8-11-2011    8-15-2011    $20
ABC     8-16-2011    8-20-2011    $15

On another table I have count of items with date stamps that I need to apply a price to depending on the date:

Vendor |    Date    |   Item Count |
ABC     8-13-2011        35
ABC     8-18-2011        40

What I want crystal reports to do is read the date from the second table and match the price that fits in the start and end dates for the price for that vendor. Is this possible? Let me know if you need further clarification.

-Neal
IP IP Logged
sharona
Senior Member
Senior Member
Avatar

Joined: 16 Oct 2008
Location: United States
Online Status: Offline
Posts: 255
Quote sharona Replybullet Posted: 26 Aug 2011 at 4:16am
create a formula
if {date2nd} in {date1} then amount else 0
 
then use manual running totals to sum by vendor
sharona
IP IP Logged
npatel
Newbie
Newbie


Joined: 16 Dec 2010
Location: United States
Online Status: Offline
Posts: 20
Quote npatel Replybullet Posted: 26 Aug 2011 at 4:50am
Will grouping by date then by vendor throw of the formula?

-Neal
IP IP Logged
sharona
Senior Member
Senior Member
Avatar

Joined: 16 Oct 2008
Location: United States
Online Status: Offline
Posts: 255
Quote sharona Replybullet Posted: 26 Aug 2011 at 6:22am
no the formula is used as a date bucket to capture the amount.
when you use the manual running totals make sure you reset on the group you want to sum by, so if you want totals by date and vendor you will need to create a set for both groups
sharona
IP IP Logged
npatel
Newbie
Newbie


Joined: 16 Dec 2010
Location: United States
Online Status: Offline
Posts: 20
Quote npatel Replybullet Posted: 26 Aug 2011 at 8:16am
Okay, thanks a bundle.
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