Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Question Involving a Rolling Date Post Reply Post New Topic
Author Message
CarlK
Newbie
Newbie
Avatar

Joined: 28 Jul 2010
Location: United States
Online Status: Offline
Posts: 13
Quote CarlK Replybullet Topic: Question Involving a Rolling Date
    Posted: 16 Dec 2010 at 7:06am

What I want is a formula that I can use iterations of (and sum the value of another field for).

Presently I am using a dateserial involving the present month and future months with a date of the 1st and the 15th for each month.  I need this to start showing what is coming after the present date.  For example i would want my first formula to show the NEXT date that is either the 1st or 15th, my next formula to show the one after that and so on.
 
What I have right now amounts to this
 
Dec 1      Dec 15     Jan 1     Jan 15
 
Since it is presently Dec 16, what I need to see is this
 
Jan 1      Jan 15      Feb 1      Feb 15
 
 
Does anyone have any ideas on how to make this work?
IP IP Logged
Keikoku
Senior Member
Senior Member


Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
Quote Keikoku Replybullet Posted: 16 Dec 2010 at 8:29am
I haven't worked with dates very much, but it seems like you've managed to get it to start at the beginning of the current month based on the current date.

So perhaps you can determine what day it is today and then decide when your start date should be. Then everything will just follow from the start date.

Edited by Keikoku - 16 Dec 2010 at 8:30am
IP IP Logged
CarlK
Newbie
Newbie
Avatar

Joined: 28 Jul 2010
Location: United States
Online Status: Offline
Posts: 13
Quote CarlK Replybullet Posted: 16 Dec 2010 at 8:40am
My problem is that everything I have is independant.  It's based off of the month of the present day instead of a specific date so presently I have one formula for the first of the present month, one for the 15th of the present month, then the first and 15th of next month, etc.  What I needs my firs on to say is more along the lines of "the upcoming 1st of 15th (whichever is closer)" and the following one to say "the 1st or 15th after that" and so on.
IP IP Logged
CarlK
Newbie
Newbie
Avatar

Joined: 28 Jul 2010
Location: United States
Online Status: Offline
Posts: 13
Quote CarlK Replybullet Posted: 17 Dec 2010 at 8:19am
I figured out a way to make this work if anyone is concerned. For my first entry:
IF today = dateserial(year(currentdate),month(currentdate),1) to dateserial(year(currentdate),month(currentdate),14) THEN dateserial(year(currentdate),month(currentdate),15) ELSE dateserial(year(currentdate),month(currentdate)+1,1)
 
second entry:
IF today = dateserial(year(currentdate),month(currentdate),1) to dateserial(year(currentdate),month(currentdate),14) THEN dateserial(year(currentdate),month(currentdate)+1,1) ELSE dateserial(year(currentdate),month(currentdate)+1,15)
 
etc.
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.016 seconds.