Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: LastMonthMTD Post Reply Post New Topic
Author Message
srklg1
Newbie
Newbie
Avatar

Joined: 10 Sep 2007
Location: United States
Online Status: Offline
Posts: 22
Quote srklg1 Replybullet Topic: LastMonthMTD
    Posted: 01 Oct 2007 at 9:54am
Hello, all!
 
I am trying to determine the syntax for determining LastMonthMTD, as well as LastYearMTD.
 
Any ideas?
 
Regards,
 
SRK
srklg1
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 01 Oct 2007 at 10:11am
Call me crazy, but what do these functions do? You want to do last month plus the MTD function? And LastYearMTD does what exactly? Are you trying to combine two functions into one?
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
srklg1
Newbie
Newbie
Avatar

Joined: 10 Sep 2007
Location: United States
Online Status: Offline
Posts: 22
Quote srklg1 Replybullet Posted: 01 Oct 2007 at 10:18am

Sorry for the confusing question, this may help clarify:

I need two different time periods in two different reports for comparative purposes:
 
For example,
 
MTD in the current month
 
and then I need
 
LastMonth for the same number of days
 
We are 1 day into October and I would need to see 1 day into September.
 
Make more sense?
 
I would also like to the same with Last Year and This year for the same month MTD. 
srklg1
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 01 Oct 2007 at 10:56am
Oh. The only way to do that is by setting up custom record selection filters. Plus, I think you'll have to do subreports to get totals for each grouping. Actually, you could avoid subreports by making a more complex record selection formula, but it depends on your CR skills.

LastMonthMTD (something like...):
Date(Year(DateAdd("m", CurrentDate, -1), Month(DateAdd("m", CurrentDate, -1), Day(CurrentDate))

LastYearMTD (something like...):
Date(Year(DateAdd("y",CurrentDate, -1), Month(CurrentDate), Day(CurrentDate))

I didn't test any of these. Just typing them in off the top of my head. So you'll probably have to tweak them to make them exact.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
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.018 seconds.