Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: display dates Post Reply Post New Topic
Author Message
magh77
Newbie
Newbie


Joined: 27 Feb 2014
Location: Tunisia
Online Status: Offline
Posts: 3
Quote magh77 Replybullet Topic: display dates
     Posted: 22 Sep 2015 at 12:10am
hello,
i have two parameter field in crystal reports:
01/01/2014:?stardate
05/01/2014:?enddate
i want a result like this:
01/01/2014
02/01/2014
03/01/2014
04/01/2014
05/01/2014
please help
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 22 Sep 2015 at 4:20am
?!? Not sure I understand the question.  Did you just need to format a date field?
IP IP Logged
magh77
Newbie
Newbie


Joined: 27 Feb 2014
Location: Tunisia
Online Status: Offline
Posts: 3
Quote magh77 Replybullet Posted: 22 Sep 2015 at 4:45am
i want to display all dates between 01/01/2014 and 05/01/2014 
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 23 Sep 2015 at 6:06am
So you want Crystal to auto generate the dates (I am assuming at the detail level)?  If so, I think it would be possible in a formula, but if that date range does not correspond to a date in the database then I am not sure what kind of results you will get.
IP IP Logged
magh77
Newbie
Newbie


Joined: 27 Feb 2014
Location: Tunisia
Online Status: Offline
Posts: 3
Quote magh77 Replybullet Posted: 24 Sep 2015 at 8:23am
it's ok finaly I solved this problem,thanks anyways:
DateVar beginDate := Date(01/01/2014);
StringVar displayResult := Cstr(beginDate);
NumberVar i;
NumberVar numberOfMonths := 5;
for i := 1 to numberOfMonths Do
    (
        displayResult := displayResult + " " + Cstr(DateValue(DateAdd("m", i, beginDate)));
    );
displayResult;

IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 24 Sep 2015 at 10:02am
That will definitely work.  I did not completely understand what you wanted to accomplish.  FYI:  If you want the beginning date and number of months you want to display tied to the start date and end date.  Your formula could be easily modified.
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