Jump to content

This topic is 8079 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

confused.gif I should be able to figure this one out, but my brain must be in holiday mode.

Ok, heres the situation. My Prospects file is related to my Sources file. Long story short, I have a variety of calc fields in the Prospects file that return "1" if they evaluate to true. These 1s are counted in the Sources file. One field is called ApptSetDt (the date an appointment is set). I need to be able to count records created in the current month that have apppointment dates in the current month OR records created in the current month that have appointment dates in the next month.

The calc I set up goes like this:

ApptDtMonthCalc=

If ((Month(ApptSetDt) = Month(Status(CurrentDate)) or (Month(ApptSetDt) = Month(Status(CurrentDate)) + 1)) , "1", "")

This calc will evaluate the first part of the statement correctly, but the current month + 1 wont work. I tried modifying the setup a little and putting it in a case function, and I tried isolating part of the or statement, to no avail.

So, what should I do differently? I have a feeling that it will be obvious when someone replies, but right now I'm temporarily retarded. Thanks for the help

Ken

Posted

The problem is that this month is December and is month number 12. January is month 1, but your calculation will come up with 13. Best to change it to:

ApptDtMonthCalc=

If ((Month(ApptSetDt) = Month(Status(CurrentDate)) or (Mod(Month(ApptSetDt),12) =Mod( Month(Status(CurrentDate)) + 1,12)) , "1", "")

Since these expressions evaluate to 1 or 0 anyway you could eliminate the If function altogether like so:

ApptDtMonthCalc=

Month(ApptSetDt) = Month(Status(CurrentDate)) or (Mod(Month(ApptSetDt),12) =Mod( Month(Status(CurrentDate)) + 1,12))

This topic is 8079 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.