The Digital Man Posted January 27, 2005 Share Posted January 27, 2005 O.K. I know this should be simple but I can't seem to figure out how to convert a date to text. I really just need the last two characters of the year. i.e. "05" how do I derive this from say TODAYS DATE. Thanks a million in advance. If anyone knows of a book that covers all the Filemaker Functions in a well organized manner i.e. either alphabetically or grouped by function and it explains how to implement them let me know. Link to comment Share on other sites More sharing options...
Maarten Witberg Posted January 27, 2005 Share Posted January 27, 2005 right(year(date_field);2) should get you there a book that covers all the Filemaker Functions: have you tried the helper? otherwise, see the book section of our hosts' site.... kjoe Link to comment Share on other sites More sharing options...
The Digital Man Posted January 27, 2005 Author Share Posted January 27, 2005 Thanks kjoe. So because the RIGHT function is a TEXT function it automatically converts the DATE(Or in this case YEAR) to TEXT? So for todays date would I use: right(year(//);2)? I guess I'm fixin to find out! Thanks again. Link to comment Share on other sites More sharing options...
Maarten Witberg Posted January 27, 2005 Share Posted January 27, 2005 actually, no, you can set the calc result to text. The default is a number. I was surprised to discover just now that the functions NumToText and DateToText have disappeared in v7. [ QUOTE ] So for todays date would I use: right(year(//);2) [/ QUOTE ] that one generated an error with me. instead, try Right(Year(Get ( CurrentDate ));2) as an unstored calculation. kjoe Link to comment Share on other sites More sharing options...
The Digital Man Posted January 27, 2005 Author Share Posted January 27, 2005 Thank you very much! My version gave me an error too. I came back here to ask for more help and to my great pleasure the answer was already posted! Much appreciated. DateToText was what I was remembering from Version 6. I thought maybe I was losing my mind when I couldn't find an appropriate function. I actually used this in a script so apparently it made the conversion for me based on the field I was populating with it. I know in the SET FIELD Calculation box it told me the Calculation result must be text. Anyway it works! Yippeeeeeeee!!! Link to comment Share on other sites More sharing options...
-Queue- Posted January 27, 2005 Share Posted January 27, 2005 GetAsText and GetAsNumber are the equivalent conversion functions in FM 7. However, FM treats dates much more cleanly, converting them to text when necessary, so the functions are required less often. For example, Enter Find Mode [ ] Set Field [datefield; gdate1 & "..." & gdate2] Perform Find [ ] is valid in FM 7. Previous versions require using Insert Calculated Result and enclosing the global dates with DateToText( ). You have to experiment to find out when the auto-conversion doesn't work. But for the most part, it's seamless. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.