2 Replies Latest reply on Aug 26, 2010 3:19 AM by LaRetta_1

    Is there a way to format a date field to automatically enter the slashes or dashes?

    user447

      Title

      Is there a way to format a date field to automatically enter the slashes or dashes?

      Post

      I'd like to be able to type only the digits into a date field, but have it come out looking like a date.

      I'd like to type in 031478 and have it show up as 03/14/1978

      I wouldn't even mind typing in 03141978

      It could be a big time saver.  Is there some kind of formatting script or filter?

      Thanks so much.  

      lr23

        • 1. Re: Is there a way to format a date field to automatically enter the slashes or dashes?
          sunmoonstar.13

          If the field is defined as a "Date" type field in Manage Database, then no, I don't think there's any way you can set it up to auto-enter the slashes.

          But, if you have FMP Advanced, you could use this custom function, which does exactly what you want:

          www.briandunning.com/cf/373

          For the custom function to work, the field must be defined as a "Text" field in Manage Database. This would only be an issue if you had other calculations in your database that referred to that field and specifically needed to operate on a "true" date, in which case, as the noted on the webpage above, you'd have to use the GetAsDate function in those calculations to extract the data from the text field as a "true" date.

          Nick

           

          • 2. Re: Is there a way to format a date field to automatically enter the slashes or dashes?
            LaRetta_1

            lr23 said, "I'd like to be able to type only the digits into a date field, but have it come out looking like a date."

            That is not standard practice through the computer world today.  Tell me one other program or website which would allow this?  Users are well versed to enter a slash or a dash; FM will accept either.  Users sometimes enter two-digit years; FM accepts this as well. 

            What you are asking is NOT a time saver - it teaches your Users to break standard industry rules.  If you want the zero before the month or number; or if you wish for standardized display of the year then use layout-level formatting on the date. 

            You will not be able to properly search this field nor sort it and you will need to always remember to wrap with GetAsDate() for calculations.  It would also break if you change system settings.

            It will NOT save any time - it will increase possibility of user error and over-complicate your design.  I suggest that you find other ways in your solution to save a bit of time. :^)