4 Replies Latest reply on Jan 22, 2009 11:31 AM by chinook

    Calendar Calc Field

    chinook

      Title

      Calendar Calc Field

      Post

      Calendar Template Table

      31 records

       

      RecordID - Number - Indexed - Auto enter, Serial

      gBaseDate Date - global

      ShowDate - Calculation - gBaseDate-Day (gBaseDate) + RecordID

      WithinSameMonth - Calculation - Case(Month(gBaseDate) = Month ( ShowDate ); RecordID)

       

      I want to modify the calc in field WithinSameMonth so that if I pick a date in BaseDate is before the 15 of the month it puts in the RecordID value and if I pick a date that is after the 15 it put in  RecordID, otherwise no value is entered. I tried the following calc but it does not seem to work:

       

       

      Case ( RecordID ≥ 15 and Month ( gBaseDate ) = Month ( ShownDate ); RecordID; RecordID ≤ 15 and Month ( gBaseDate ) = Month ( ShownDate ); RecordID; "" )<!--  POLLS  --><!--  FILES  --><!--  SIGNATURE  -->

        • 1. Re: Calendar Calc Field
          TSGal

          chinook:

           

          Thank you for your post.

           

          I'm still not sure why you want to check for the 15th.  The result is still RecordID.  Maybe there is something you forgot to include with your explanation.

           

          Why doesn't the following formula work:

           

          If (Month (gBaseDate) = Month (ShownDate); RecordID; "")

           

          TSGal

          FileMaker, Inc. 

          • 2. Re: Calendar Calc Field
            chinook
              

            Ok, I am trying to set up a 2 week time sheet that that shows the user the dates 1-15 or 16 to end of month

            in a portal on a different table linked to the table described above by a cartesian join to the field WithinSameMonth.
            The field gbaseDate is on this table
            Presently the portal shows all days of the month, but what I want is just 1-15 or 16 to end of month depending on selection in gbaseDate.

             

            So if the month in gbaseDate and month in ShowDate are the equal and the day in ShowDate is less than or equal to 15 then put the value from RecordID in WithinSameMonth.

            Else if the month in gbaseDate and month in ShowDate are the equal and the day in ShowDate is greater than 15 then put the value from RecordID in WithinSameMonth.

            • 3. Re: Calendar Calc Field
              TSGal

              chinook:

               

              I'm reading your reply, and I'm still confused.  It seems that no matter what the date is, you are still putting the value from RecordID in WithinSameMonth.  Correct?

               

              TSGal

              FileMaker, Inc. 

              • 4. Re: Calendar Calc Field
                chinook
                  

                Thanks for your reply.

                 

                Yes, I believe I confused myself also.

                 

                The calc. I came up with gives me what I need in the WithinSameMonth field.

                 

                Case ( Day ( gBaseDate ) ≤ 15  and  Day ( ShowDate ) ≤ 15  and Month ( gBaseDate ) = Month ( ShowDate ) ; RecordID;
                Day ( gBaseDate )   >   15  and  Day ( ShowDate )   >   15 and Month ( gBaseDate ) = Month ( ShowDate ); RecordID;  "" )