Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Returning only the newest record on subreport Post Reply Post New Topic
Author Message
Javamahnn
Newbie
Newbie


Joined: 26 May 2009
Location: United States
Online Status: Offline
Posts: 3
Quote Javamahnn Replybullet Topic: Returning only the newest record on subreport
     Posted: 26 May 2009 at 9:28am

I have a simple report that is being used to verify tax setup.   The core tax information is held in a couple of tables but the tax rate is stored in a '1 to many' table with effective date for historical purposes ( 1 tax can have many tax rate/effdate combinations) .

I am using a subreport to pull the tax rate information and currently it lists all the tax rates/effdate records for a particular tax.  I am only interested in the newest record.

The report is using tables and not procedures, how do i limit the data returned to the newest record ?

thanks in advance
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 26 May 2009 at 10:06am
Why not  just join it in your main report and use a select statement to limit rows to only returning the items with the current tax value?
Something like "currentdate in taxbegindate to taxenddate"...
IP IP Logged
Javamahnn
Newbie
Newbie


Joined: 26 May 2009
Location: United States
Online Status: Offline
Posts: 3
Quote Javamahnn Replybullet Posted: 26 May 2009 at 10:36am
The 'newest' record does not have the same date between different tax types.  CA sales tax for instance was just changed in April, but Nevada hasn't changed in eons.  So there is no real criteria i can look for other than that the record is the newest of the set.
IP IP Logged
rahulwalawalkar
Senior Member
Senior Member
Avatar

Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
Quote rahulwalawalkar Replybullet Posted: 27 May 2009 at 3:53am
Hi
 
What you can do is
Group on State Name i.e. CA,Nevada,
and then on Tax Type
and then do insert summary in which you select the effective date and type of summary as Maximum so it will give you the max effective date i.e. the newest date for the tax type in the subreport...
 
cheers
Rahul
IP IP Logged
Javamahnn
Newbie
Newbie


Joined: 26 May 2009
Location: United States
Online Status: Offline
Posts: 3
Quote Javamahnn Replybullet Posted: 27 May 2009 at 8:49am
Thanks all for the ideas, I'll give this a try and let ya know.  I appreciate your efforts !!
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