February 19, 201312 yr Newbies hello, i hope someone can help me with this. I am creating a field that is a concatenation calculation, the purpose of which is to combine multiple pieces of information into a unique number that will be used on our contracts. One of the pieces of information to be included is the date of the contract. I am picking that up from a Creation Date field and trying to GetAsText so it will appear in the concatenated number as just a string of digits (say, 021513.) Currently that is how I've formatted it to appear in the Creation Date field. But when it gets picked up, even with GetAsText, the date formatting returns" 02/15/13." Here is what the concatenation calculation looks like so far: Contract Number_Company Code & "-" & Contract Number_Department Code & "-" & GetAsText ( Contract Number_Date record created ) &"-"& Contract Number_Sequential Component I tried setting the Calculation result to text and still the date appears as 02/15/13. What do I need to do to change the date into a simple string of numbers that is the same as the date but without the date formatting? I'm baffled! Thanks! jmm
February 19, 201312 yr look at this: http://fmforums.com/forum/topic/87626-calculation-with-date-as-text/?hl=parse+date my suggestion would be to make a separate calc field that creates your number string - as in above example, then use that field in your concatenation calc. Martie
February 19, 201312 yr See help for date functions: http://www.filemaker.com/12help/html/func_ref1.31.17.html#1028277 The various parts of a date can be extracted separately. So for instance to get a date in YYYYMMDD format: Year( Contract Number_Date record created ) & right( "00" & month( Contract Number_Date record created); 2) & right( "00" & day( Contract Number_Date record created); 2)
February 19, 201312 yr What will the id be used for? If this is for a relationship, if so, in v10 it is better to use the Auto Enter Serial Number. Try either Filter ( date ; "0123456789" ) or Substitute ( date ; "/" ; "" )
February 19, 201312 yr Author Newbies Thanks! The link Martie provided worked - except for the fact I am trying to get MMDDYY and what I got was MMDDYYYY. Apparently that is the numbering system preferred by our corporate office. (This is all to create an auto-generated number for contracts.(A unique number but not serving as a unique identifier in the database, though.) Any thoughts on how to get it to include only the last two digits of the year? (I am not all that experienced at calculations.) Thanks in advance! jmm
February 19, 201312 yr Right ( "00" & Day ( date ) ; 2 ) & Right ( "00" & Month ( date ) ; 2 ) & Right ( Year ( date ) ; 2 ) 2/19/2013 to 190213 Right ( "00" & Month ( date ) ; 2 ) & Right ( "00" & Day ( date ) ; 2 ) & Right ( Year ( date ) ; 2 ) 2/19/2013 to 021913
Create an account or sign in to comment