5 Replies Latest reply on Feb 27, 2014 7:14 AM by philmodjunk

    Date format when using Substitute or Merge

    Annette

      Title

      Date format when using Substitute or Merge

      Post

           Hi, 

           I was just wondering if there is a way to format the way a date appears if you are using substitute or merge fields?

           I have letter templates where I use substitution of fields where I have certain text, some of those are date fields and it always defaults to dd/mm/yyy format but sometimes in a letter I would like it to have the date written in long format.  

           To give you an idea of what I mean I have two fields, one is letter text (text field), the other letter body (calculation).  In the letter text I have the letter template.  Dear <<NAME>>, thank you for your letter which I received on <<LetterReceiptDate>> etc etc.  Then the Letter Body field substitutes <<NAME>> with the Name field of that record, <<LetterReceiptDate>> with the date.

           Seems like a small thing but sometimes the date just looks better in letters written out in long format.  

           Thanks for any help!

        • 1. Re: Date format when using Substitute or Merge
          philmodjunk

               For merge fields, you can select the text object that contains the merge field and then use Data formatting in the inspector to specify a date format. This one date format will apply to all date fields in the text block so this method only works if all date fields in the text block can all use the same date format. This is true for all other field types as well. You can specify one number format, for example and it will apply to all number fields in the text block.

               I am not sure that I know what you mean by a "substitute" field. I know of a substitute function, but not a substitute field by that name.

          • 2. Re: Date format when using Substitute or Merge
            Annette

                 Hi Phil, it's the substitute function I'm using in the letter body calculation field.  Good to know about merge fields, now to figure out how to do same with substitute functions.  

            • 3. Re: Date format when using Substitute or Merge
              philmodjunk

                   Why would you need to? Just export the substituted text.

              • 4. Re: Date format when using Substitute or Merge
                Annette

                     I have a table which is standardized letters.  But in some cases they may need to be tweaked slightly.  So, I have one table (LetterTemplates) which is those templates.  I had all merged fields in there for the info I wanted it to pull from the record for the client.  I have a table called Client_Letters, all letters sent to the client.  What I want to do is when I go to this table to select a letter to generate, have it pull up the template, then allow the template to be altered for that letter only not altering the template permanently.  So I have used a lookup on the client_letters table to the LetterTemplates table.  Only problem was when using a lookup it does not merge the fields.  Just puts it as text within the << >> .  So my work around for that was to use the substitute function.  Wherever it saw <<Text>> replace it with a specified field.  But no matter what format that date field is in, it seems to substitute it in the dd/mm/yy format.

                • 5. Re: Date format when using Substitute or Merge
                  philmodjunk

                       Sorry, please disregard that last post. It was intended for someone else. To get a date with a particular format into a calculation returning text, you'd need to create the formatting with a calculation. If you check, you'll find that there's a number of functions that return things like the name of the month, the name of the day of the week, the number for the day, month and year so you can concoct a calculation that combines those functions to produce nearly any date format that you need.