Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Need help to change date Post Reply Post New Topic
Author Message
overcharge
Newbie
Newbie
Avatar

Joined: 12 Mar 2010
Location: Malaysia
Online Status: Offline
Posts: 12
Quote overcharge Replybullet Topic: Need help to change date
     Posted: 12 Mar 2010 at 2:34am
Hi all expert,
 
I encounter a problem when i create a statement report.
I need to show start date and end date of a record.
For start date column, there is no problem, but for end date column, there is some null inside.
 
For example, Call Date: 10-Oct-2009
                     Previous Call Date:
 
In the previous call date should be 3-Oct-2009 in weekly mode or 9-Oct-2009 in daily mode due to {?period}. Please consider there is possibilities of month and year changing.
 
What should i set to my {@Previous Call Date} in oder to get the answer i want?
 
 
Thank you.
 
 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 12 Mar 2010 at 6:20am

in your formula you would do something like:

local numbervar d;
 
if isnull({table.enddate}) then
  if weeklyMode then
    dateadd("d",-7,{table.startdate});
  else
    dateadd("m",-1,{table.startdate});
else
 {table.enddate}
 
HTH
IP IP Logged
overcharge
Newbie
Newbie
Avatar

Joined: 12 Mar 2010
Location: Malaysia
Online Status: Offline
Posts: 12
Quote overcharge Replybullet Posted: 14 Mar 2010 at 3:44pm
Thanks pal, i could solve my problem now. Wink
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