Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Show dates greater than Current date Post Reply Post New Topic
Page  of 2 Next >>
Author Message
ashisahb
Groupie
Groupie


Joined: 15 May 2008
Location: India
Online Status: Offline
Posts: 48
Quote ashisahb Replybullet Topic: Show dates greater than Current date
    Posted: 09 Aug 2008 at 4:56am
Hi ,
 
I have a column in a report which is consisting of different dates.I need only those dates to be visible which are greater than or equal to current date,rest of the fields in that column should come as blank.
 
Any help appreciated.
 
Thanks,
Ashish.
Regards,
Ashish
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 09 Aug 2008 at 12:32pm
You can use the built-in function 'CurrentDate' to get today's date and use that in your record selection formula.
 
I have all the CR date-time functions fully documented in chapter 6 of my Encyclopedia book. You can find out more about my books at Amazon.com or reading the Crystal Reports eBooks online.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
ashisahb
Groupie
Groupie


Joined: 15 May 2008
Location: India
Online Status: Offline
Posts: 48
Quote ashisahb Replybullet Posted: 15 Aug 2008 at 4:51am
Thanks for the reply.
 
but i am still having the issue.
 
I am using the following formula:
 
if(isnull({cp.pendingSettlementDate})) then
totext(" ")
else if ((totext({cp.pendingSettlementDate})>(totext(CurrentDate)))then
totext({cp.pendingSettlementDate})
 
but its not working.Can you provide me the exact formula.
 cp.pendingSettlementDate is the field i am having data.
Regards,
Ashish
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: 15 Aug 2008 at 5:09am
Hi
 
Are you getting errors ? what is not working can you let us know?...
 
in the meantime............
 
In your record selection formula try this
 
cp.pendingSettlementDate >= currentdate  which will filter all the records which have  less then current date.
 
or
 
for column
 
Create formula frm
 
if isnull({cp.pendingSettlementDate}) then
""
else if
totext ({cp.pendingSettlementDate})>  totext(currentdate) then
totext({cp.pendingSettlementDate})
 
or
try this
 
if {cp.pendingSettlementDate} >  currentdate then
{cp.pendingSettlementDate}
 
Cheers
Rahul


Edited by rahulwalawalkar - 15 Aug 2008 at 5:37am
IP IP Logged
themessenger
Groupie
Groupie
Avatar

Joined: 15 Aug 2008
Location: United Kingdom
Online Status: Offline
Posts: 48
Quote themessenger Replybullet Posted: 15 Aug 2008 at 6:09am
Why using ToText on the logic test?

Does:

if(isnull({cp.pendingSettlementDate})) then
totext(" ")
else if ({cp.pendingSettlementDate}>(CurrentDate))then
totext({cp.pendingSettlementDate})


not work?
Managing Director
www.allmymenus.com
IP IP Logged
ashisahb
Groupie
Groupie


Joined: 15 May 2008
Location: India
Online Status: Offline
Posts: 48
Quote ashisahb Replybullet Posted: 15 Aug 2008 at 6:16am

Hi ,

i dont want to filter all the rows , just want to suppress the rows which are greater than or equal to current date.
 
i tried the solution u provided,but didnt work...it just suppressing all the rows
 
Any other idea...
Regards,
Ashish
IP IP Logged
themessenger
Groupie
Groupie
Avatar

Joined: 15 Aug 2008
Location: United Kingdom
Online Status: Offline
Posts: 48
Quote themessenger Replybullet Posted: 15 Aug 2008 at 6:24am
If that response is to me then where are you putting this logic?

It should be in a formula, with the formula field replacing the database field.
Managing Director
www.allmymenus.com
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: 15 Aug 2008 at 6:47am

Hi,

if it is suppressing all the records means their is no
{cp.pendingSettlementDate} which is greater then or equal to currentdate in your table
 
any way... try this
 
You have to create a formula
 
frm1
 
Place the code below in the formula
if {cp.pendingSettlementDate} >=  currentdate then
{cp.pendingSettlementDate}
 
 and then place the formula in details section.
 
cheers
Rahul
 

 


Edited by rahulwalawalkar - 15 Aug 2008 at 6:50am
IP IP Logged
ashisahb
Groupie
Groupie


Joined: 15 May 2008
Location: India
Online Status: Offline
Posts: 48
Quote ashisahb Replybullet Posted: 15 Aug 2008 at 7:22am
no that was not for you themessenger
And when we try with removing totext ..it simply gives an error saying "A String is required here"
Regards,
Ashish
IP IP Logged
ashisahb
Groupie
Groupie


Joined: 15 May 2008
Location: India
Online Status: Offline
Posts: 48
Quote ashisahb Replybullet Posted: 15 Aug 2008 at 7:24am
Rahul....
there is data in that column ...i have seen it with removing the formula.
 
the formula u gave me...i tried it already ....didnt work ..jus suppressing all the data
 
Regards,
Ashish
IP IP Logged
Page  of 2 Next >>
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.047 seconds.