Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: MTD formula Post Reply Post New Topic
Author Message
elie234
Groupie
Groupie


Joined: 21 Aug 2009
Online Status: Offline
Posts: 68
Quote elie234 Replybullet Topic: MTD formula
    Posted: 29 Sep 2009 at 8:16am
Hi I am doing a report that reports on certain data for the previous day as well as month to date. I was using just a record select in MonthToDate to get the MTD but then I realized that this won't work for the first of the month when I would like to get data for the previous month. What would be the formula to get the previous month of data when the print date is the 1st of the month?
Ideally I would like to put that into record selection although that might not be possible.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 29 Sep 2009 at 9:09am
if day(currentdate)=1 then
{table.datefield} in LastFullMOnth
else
{table.datefield} in MonthToDate
IP IP Logged
elie234
Groupie
Groupie


Joined: 21 Aug 2009
Online Status: Offline
Posts: 68
Quote elie234 Replybullet Posted: 29 Sep 2009 at 9:12am
Thanks!
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.