Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Grouping Name Formula help. Post Reply Post New Topic
Author Message
mikevtss
Newbie
Newbie
Avatar

Joined: 04 Dec 2012
Online Status: Offline
Posts: 13
Quote mikevtss Replybullet Topic: Grouping Name Formula help.
    Posted: 28 Jun 2016 at 1:07pm
Hello all,

So i have grouped a data field to group the data by monthly transactions.

But I want to change the Grouping name field from the default display of just the month and year {05/2016}

Is it possible to have a formula to have the group name display as the month date range.

eg.

01/05/16 to 31/05/16
(May Transactions)

01/06/16 to 30/06/16
(June Transactions)

any help will be appreciated.

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 29 Jun 2016 at 8:00am
select the group group field
right click and select format field
select common tab
select formula button for 'Display String' option


NumberVar y;
NumberVar m;
DateVar firstday;
DateVar lastday;
StringVar t;
y:= YEAR((Minimum ({table.TransactionDate}, {table.TransactionDate}, "monthly")));
m:= MONTH((Minimum ({table.TransactionDate}, {table.TransactionDate}, "monthly")));
firstday:=DATESERIAL(y,m,1);
lastday:=DATESERIAL(y,m+1,1-1);
t:= TOTEXT(firstday,'d/M/yy') + ' to ' + TOTEXT(lastday,'d/M/yy')
IP IP Logged
mikevtss
Newbie
Newbie
Avatar

Joined: 04 Dec 2012
Online Status: Offline
Posts: 13
Quote mikevtss Replybullet Posted: 29 Jun 2016 at 3:54pm
Thank you DBlank! works a dream!

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.031 seconds.