Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Need To Create Box That Shows Previous Month Label Post Reply Post New Topic
Author Message
Repent34
Newbie
Newbie


Joined: 03 Mar 2011
Location: United States
Online Status: Offline
Posts: 19
Quote Repent34 Replybullet Topic: Need To Create Box That Shows Previous Month Label
     Posted: 23 Aug 2011 at 8:28am
I am using CR2008

I am creating a report for our salesmen and one of the fields in the report will be a text box that shows what the last month was. For instance, if the report is run this month, the report will plug July 2011 into the box because that was what last month was. Tied to this will be a salesman's total sales for last month that should show up in a box. I will place this box right next to the salesman's name on the report as the names will be static.

I have several of these to do and if I can see the method I can re-create it for the others.

How would I do this?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 23 Aug 2011 at 9:15am
monthname(month(dateadd('m',-1,currentdate)))
IP IP Logged
Repent34
Newbie
Newbie


Joined: 03 Mar 2011
Location: United States
Online Status: Offline
Posts: 19
Quote Repent34 Replybullet Posted: 24 Aug 2011 at 8:04am
I tried that code and the output is "July" with no year info.  Also would like to abbreviate the month to keep column sizes down.

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 24 Aug 2011 at 8:13am
totext(dateadd('m',-1,currentdate),'MMM yyyy')
IP IP Logged
Repent34
Newbie
Newbie


Joined: 03 Mar 2011
Location: United States
Online Status: Offline
Posts: 19
Quote Repent34 Replybullet Posted: 25 Aug 2011 at 5:20am
Originally posted by DBlank

totext(dateadd('m',-1,currentdate),'MMM yyyy')


Thank you DBlank that works well.  I've been trying to find a forum to ask for help or to find answers and this looks to be a good one.  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