Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Problem listing previous month Post Reply Post New Topic
Author Message
NHerrmann
Newbie
Newbie
Avatar

Joined: 05 Jan 2011
Online Status: Offline
Posts: 2
Quote NHerrmann Replybullet Topic: Problem listing previous month
     Posted: 05 Jan 2011 at 10:25am
Hello All and thank you in advance for any help.
I am using CR 11.

I am running reports that I wrote from a server that auto-runs reports for our managers. Recently I got an error that the report failed because the month number needed to be between 1 and 12.
I am curious because I have used this formula
    MonthName (Month (CurrentDate)-1 )
in the past to show the month before on the report. Now it is showing an error. I have searched the posts and could not find any information on this.
Thank you all
Impossible is Nothing

NHerrmann
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 05 Jan 2011 at 12:05pm
because the currentmonth number is 1
-1
=0
which has no matching month
try
table.datefield in lastfullmonth
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 05 Jan 2011 at 12:07pm
or
MonthName (Month (dateadd('m',-1,currentdate)))
 
IP IP Logged
NHerrmann
Newbie
Newbie
Avatar

Joined: 05 Jan 2011
Online Status: Offline
Posts: 2
Quote NHerrmann Replybullet Posted: 06 Jan 2011 at 4:06am
Thank you. I was not thinking about 1-1 for month code.
Impossible is Nothing

NHerrmann
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