4 Replies Latest reply on Jul 27, 2011 11:32 AM by Tbear

    Invoice "Date Due" question

    Tbear

      Title

      Invoice "Date Due" question

      Post

      On the "Event Invoice" layout I have a 'Date Due' field that worked fine calculated as EVENT::StartDate - 7. However it is possible for customers to order tickets for multiple events with different start dates.

      How do I make 'Date Due' look at the earliest of multiple start dates? (Invoice table and Event table has a LineItem (join) table which they both relate 1-to-many to). I have a portal on the Invoice layout that looks at Line Items and the portal records are sorted by event Start Date.

        • 1. Re: Invoice "Date Due" question
          philmodjunk

          You can use the Min function to return the minimum value from a set of related records--the earliest start date in your case.

          Min ( event::StartDate ) - 7

          Should work if I've interpreted your table structure correctly.

          • 2. Re: Invoice "Date Due" question
            Tbear

            It worked perfectly. I was back to reading all the manuals I have and ran across the "Max()" function and was wondering if there was a "Min()" when your answer arrived. Thanks again so very much.

            Learning the functions and how to put them together is very difficult for me - I have zero experience with anything like it but it's fun. I can't believe how many things there are to learn with regard to all the functions. I've been doing this for 3 months now and feel like I have not scratched the surface.

            • 3. Re: Invoice "Date Due" question
              philmodjunk

              Reviewing the list of Functions in Help--Especially the "swiss army knife" Get () function can be very enlightening. Then you can fire up a test file and test your new discoveries to see how they work. Wink

              • 4. Re: Invoice "Date Due" question
                Tbear

                Tongue out  Whew! I worked on this stuff for 10 hours yesterday and today have done nothing but read functions info in 'The Missing Manual'. The more I read, the more I want to tweak things - this could take over one's life...