12 Replies Latest reply on Apr 21, 2010 11:59 AM by selmorzine

    Creating a Calculation to set a date in the future

    selmorzine

      Title

      Creating a Calculation to set a date in the future

      Post

      Hi,

      I am new to FM pro 11 and need to find out how to do the following;

      I have built a booking system where with every new booking, it creates a booking date. I need to create a calculation so that I can set in another field a deposit due date and booking due date.

      The deposit due date will be based on 6wks after the booking date and booking due date needs to be based on 6 wks prior to the arrival date.

      How do I do this? Can anyone help me please?

       

      Many thanks,

      Sally

        • 1. Re: Creating a Calculation to set a date in the future
          LaRetta_1

          Both new dates should be standard dates with auto-enter (replace) by calculation.  This allows for exceptions.

           

          Deposit Due date:  BookingDate + 6 * 7

          Booking Due date:  ArrivalDate - 6 * 7

           

          UPDATE:  The (replace) portion on the auto-enter dates means that you should uncheck 'Do not Replace Existing value if any."

           

          • 2. Re: Creating a Calculation to set a date in the future
            LaRetta_1

            And yes, you can just add or subtract 42.  I used 6 * 7 to indicate '6 weeks' for clarity.  I was teased about using it instead of 42.  :smileyvery-happy:

            • 3. Re: Creating a Calculation to set a date in the future
              selmorzine

              Brilliant, I will give this a go! I am new to designing my own so not get on the calculation front.

               

              Thanks

              • 4. Re: Creating a Calculation to set a date in the future
                selmorzine

                Once I go to specify the calculation, I have choosen booking date then + 6*7 or + 42 and then ok but it doesn't seem to work. I have removed all formatting from the date. Is there anything else that I haven't ticked or done?

                 

                Thanks,

                Sally

                • 5. Re: Creating a Calculation to set a date in the future
                  LaRetta_1

                  Hi Sally,

                   

                  It would be easiest if you set it as calculation (result of date) instead of auto-enter (replace).  In this way, you won't have to change existing data.  My apology; I don't know where my mind was the first time.   Make sure that your fields are date and that the calculation result is date as well.

                   

                   

                  • 6. Re: Creating a Calculation to set a date in the future
                    selmorzine

                    Hi,

                     

                    Sorry, I am being dumb!

                    This is what I am doing but it doesn't seem to work;

                    I go to the fields option in Manage Database, click on the relevant field Date deposit due, then in "Auto enter" click on Calculated value, then specify, in specify calculation I choose booking date + 42 and it appears at the bottome Calculation result must be Date. I click OK  and then it doesn't work. Either I am in the wrong place or there is somewhere else to do the calculations.

                     

                    I am obviously don't something wrong but haven't got a clue, sorry! I am new to all of the calculation stuff, so need to learn.

                     

                    Many thanks,

                    Sally

                     

                    • 7. Re: Creating a Calculation to set a date in the future
                      LaRetta_1

                      Oh hey, Sally, not to worry, we ALL have struggled with this stuff and  I switched streams on you, suggesting first an auto-enter calculation and then switching to field as type calculation. :smileysurprised:

                       

                      Back up before doing anything new.  Then open your field definitions and select your Deposit Due field.  To the right is a popup where you specify the data type of the field.  Change it there to 'calculation' then click 'change.'  FM may warn you but that's okay.  The calculation dialog will pop open and it should still have your formula in it of booking date + 42.    Now at the bottom, change it to date.

                       

                      You should be set.  Repeat with your other calculation. :smileyhappy:

                      • 8. Re: Creating a Calculation to set a date in the future
                        selmorzine

                        Wicked, that worked a treat!

                        I hadn't done it that way round as it gives you more options.

                         

                        I am now in the process of trying to make a booking of products option, so might contact you again. Can you recommend any good websites or books that can help me with the overall learning and building process?

                         

                        Thanks again,

                        Sally

                         

                        • 9. Re: Creating a Calculation to set a date in the future
                          LaRetta_1

                          I can't recommend any book specifically but any book by Ray Cologon, PhD would never steer you wrong.  For searching, use FMForums (their search capabilities are better than this forum).  For assistance, most of us Developers answer on both sites (and others as well).

                          • 10. Re: Creating a Calculation to set a date in the future
                            mrvodka

                            I suggest the Missing Manual. Geoff has a way of explaing stuff that makes it easier for newbies.

                            • 11. Re: Creating a Calculation to set a date in the future
                              selmorzine

                              Thanks, I think that I am going to have to give this a go, getting too technical for me now!

                              • 12. Re: Creating a Calculation to set a date in the future
                                selmorzine

                                Hi there,

                                 

                                As I am having no luck with the next part of my database, no one is answering my question on the forum and you were such a help last time, I thought that I would ask you again for some help!

                                 

                                I am creating a booking system which was going well until now. I have created a Contacts layout/table which is then linked into a Bookings layout/table (all relationships work fine) then I have a Products layout/table that is not linked to anything yet.

                                This is what I would like to do or need to do;

                                I want to create a portal on the booking page, that will allow me to book different products and as many as I want (i.e. product name, hours, people, price (this comes from products page) plus choose times and add peoples names per product booked

                                And then create an invoice with everyone's details, including all slots booked for that booking.

                                 

                                I think that I will be fine with the Invoice part, I just can't get the portal to work.

                                I found an Invoice demo online and mirror this, creating a Line layout/table and an Invoice layout/table, linked everything in exactly the same and still can't get it to work!!!!!!!

                                 

                                I know that this can be done as the template that comes with filemaker pro for the Invoicing does exactly what I want but I can't work out how to do it.

                                 

                                Any help would be very much appreciated.

                                Many thanks,