March 12, 200916 yr Through a web form FileMaker receives a text like this: Friday, 6 March, 2009 How to convert this into a FileMaker compatible date field like this: 3/6/2009? I am stuck with it and don't know what to do. Is there an easy method or complicated calculation available? Any help would be great. Cheers Greg
March 12, 200916 yr Try something like: Date ( Ceiling ( Position ( "janfebmaraprmayjunjulaugsepoctnovdec" ; Left ( MiddleWords ( ImportedDate ; 3 ; 1 ) ; 3 ) ; 1 ; 1 ) / 3 ) ; MiddleWords ( ImportedDate ; 2 ; 1 ) ; MiddleWords ( ImportedDate ; 4 ; 1 ) )
March 12, 200916 yr Author Thanks, found a solution: http://www.briandunning.com/cf/852 Custom Function: GetTextAsDate (dateTxt; formatTxt) ... which I hopefully get to work! Cheers Edited March 12, 200916 yr by Guest
March 12, 200916 yr Holy Mule! Why use a long convoluted custom function when a clean, simple, tiny calculation will do it?
March 12, 200916 yr Author If I only would be able to get the 'clean, simple, tiny calculation' get to work. Do you have a solution? Cheers Greg
March 12, 200916 yr Author Perfect now. It did not work because I changed the format of the imported date. Great sample, thanks a lot! Greg
March 12, 200916 yr Well now, I liked that, Michael. I've used similar calcs to find the position of the short months but I've always used 1+Position(etc... ). But adding 1 is sloppy because it just changes 1.3333333333 to 2.3333333333 after divided by 3. Your method of using Ceiling precisely rounds up to 2; no trailing .333333's. It's a good reminder ... I don't think I take advantage of Ceiling() often enough. Edited March 12, 200916 yr by Guest
Create an account or sign in to comment