1 Reply Latest reply on Jul 22, 2011 1:16 PM by philmodjunk

    determining next issue

    jayGamel

      Title

      determining next issue

      Post

      I need to pick out a number from a list that depends on the date. magazine publishes 22 issues a year. based on today, I want to pick the issue number of the next issue coming up and use if for several functions, finding advertisers to call, classifieds to call, billing dates, etc. It is driving me bats, but I know it should be simple.

      I have a table of print dates and issue numbers. I can figure out subscription end dates with a self-join, but I need the current issue as a global number I can pick up for other tables. How can I set it up and keep it current?

      Screen_shot_2011-07-22_at_12.46.20_PM.png

        • 1. Re: determining next issue
          philmodjunk

          The next issue would be the smallest issue date in this table that would also be greater than today's date.

          Set up this relationship:

          MainTable::cToday < Issues::IssueDate

          and specify that the records in Issues be sorted by IssueDate in ascending order.

          Then a reference to Issues::IssueDate from MainTable will refer to the next issue to be produced.

          cToday would be the unstored calculation field: Ge t( CurrentDate )

          You can also perform a find for all records with IssueDate > Today's date and sort the found set by IssueDate in ascending order. Then the first record in the found set will be the next issue.