1 Reply Latest reply on Aug 11, 2010 8:54 AM by philmodjunk

    Converting barcode text into date field



      Converting barcode text into date field


      I have a bar code field and a temp barcode field. The bar codes look like this when scanned


      I am running a script to rip the left 6 characters to use as the identifier and put into the final barcode field, the characters after the comma as the Lot# which go into the lot# field and need to take the last 6 charecters and put into the expiration date field. 

      The problems are formatting based I believe, and 2 fold. The barcode is being entered as text. The date as scanned is YY MM DD. When i rip the 6 characters out using the right function, and place in the exp date field using a set field I think 1) it doesn't like that it is text, and 2) that the order is funky. 

      So first, how do I address the formatting issue of text to date?

      As for the order i think I can do all sorts of trickery such as ripping the characters 2 at a time, then pasting them into some other field or variable and appending the other characters until I get a nice order. That seems like overkill. Any ideas?

        • 1. Re: Converting barcode text into date field

          A simple solution is to set up fields, one for the text and the second a calculation field or auto-entered calcualtion that converts the text into a filemaker date.

          Here's one such calculation:  Date ( Middle ( DateText ; 3 ; 2 ) ; Right ( DateText ; 2 ) ; "20" & Left ( DateText ; 2 ) )

          You'd put the scanned 110228 into the DateText field and this calculation will return 2/28/2011 (in MMDDYYYY format)