Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Current month Post Reply Post New Topic
Author Message
cfrey
Groupie
Groupie


Joined: 06 Feb 2008
Location: United States
Online Status: Offline
Posts: 55
Quote cfrey Replybullet Topic: Current month
    Posted: 28 Jun 2010 at 9:29am
Hello,

I am selecting data and accumulating money based on whether a date is in the current month or the current month last year.

I Currrently am using MonthToDate and LastYearMTD. But I need to see any future records for this month also.

As an example if it is June 15 and my record is dated June 30 it will not show in my report.

What would be the easiest way to handle this?

Thank you/
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 29 Jun 2010 at 3:54am
local numbervar thisMonth := MONTH(today);
local numbervar thisYear := YEAR(today);
local numbervar dataYear := YEAR({table.field});
 
if MONTH({table.field}) = thisMonth then
  if dataYear = thisYear or dataYear = thisYear - 1 then
    //good data
  else
    //bad data
else
  //bad data
 
should work...
 
HTH
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.