Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Return one result from a list Post Reply Post New Topic
Author Message
neilsja
Newbie
Newbie


Joined: 03 Oct 2011
Location: United Kingdom
Online Status: Offline
Posts: 12
Quote neilsja Replybullet Topic: Return one result from a list
    Posted: 27 Jan 2012 at 1:43am
Hi
 
I have what is a probably a simple answer, but I cannot seem to find the solution.
 
I have 4 dates:
 
01/01/2011
01/01/2012
01/01/2013
01/01/2014
 
All I want to do is return the first record after currentdate.
 
So as today is the 27/01/2012, all I want displayed is 01/01/2013.
 
I have only got this far by adding a function:
 
01/01/2011   FALSE
01/01/2012   FALSE
01/01/2013   TRUE
01/01/2014   TRUE
 
Thank you for your assistance.
 
 
IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 27 Jan 2012 at 5:19am
you could try
putting something like
table.date > currentdate
 into your select expert
then create a formula like
minimum(table.date)
IP IP Logged
rkrowland
Senior Member
Senior Member
Avatar

Joined: 20 Dec 2011
Location: England
Online Status: Offline
Posts: 259
Quote rkrowland Replybullet Posted: 27 Jan 2012 at 5:25am
The following formula will return the 1st of Jan in the year after the current year. If it's always the 1st of Jan you want to return you could use this to compare your dates too.
 
date(year(currentdate)+1,1,1)
IP IP Logged
IdoMillet
Groupie
Groupie


Joined: 26 Oct 2007
Location: United States
Online Status: Offline
Posts: 99
Quote IdoMillet Replybullet Posted: 29 Jan 2012 at 9:32am
1. Remove all records before current date using a simple record selection formula: {Your_Date} > CurrentDate

2. Return the minimum date for the remaining records
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
www.MilletSoftware.com
IP IP Logged
neilsja
Newbie
Newbie


Joined: 03 Oct 2011
Location: United Kingdom
Online Status: Offline
Posts: 12
Quote neilsja Replybullet Posted: 30 Jan 2012 at 4:15am
Thank you, it worked a treat!
 
Newbies have to learn!
 
Many thanks.
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.017 seconds.