Echo33029 Posted March 31, 2004 Posted March 31, 2004 I am not sure if I am seeing a bug with the new Replace contents command or if I am just doing something wrong. I am trying to replace a date in a master table with the max of the dates in a related table. Using the replace contents function either from the menu or in a script results in a number being entered into the field, it looks like a Julian date or some other internal representation used by FM7. Trying this with the Set Field command works fine. I have attached a sample file. What am I missing? Echo Version: v7.x Platform: Windows XP TestDB.zip
Reed Posted March 31, 2004 Posted March 31, 2004 I can verify that this happens on OS X as well.... I created a calc field with a date result in the main table with the same formula and that field has a date format. If I replace the contents of the portal fields with that field, the problem does not occur. I have attached the modified file TestDB-1.fp7.zip
Echo33029 Posted March 31, 2004 Author Posted March 31, 2004 I see the same thing in WinXP. Basically it appears that the max function is returning the correct result in the correct field format, but when it is used in conjunction with the Replace command, the Replace command does not enter the data into the field in the correct format.
Neverland Posted April 2, 2004 Posted April 2, 2004 How about trying... GetAsDate ( Max ( RelatedTable::Dates ) ) ...when using the Replace Records feature. That should do what you are looking for. SR FileMaker Version: Dev 7 Platform: Windows XP
Tyfud Posted April 2, 2004 Posted April 2, 2004 GetAsDate ( max(relatedTable::Date) ) Will work. The problem is FM starts counting dates from some arbitrary date and up. So it seems it still stores dates as numbers, and Max() is a numerical function. Not a date function. So it's going to return the numerical value of the date.
Echo33029 Posted April 2, 2004 Author Posted April 2, 2004 GetAsDate works just fine. Thanks. I believe that the max function is more than just a simple numerical function. It is supposed to accept many different data types, and return the same type as it's input parameters. It works just fine when used with a Set Field calculation, but not the Replace calculation.
Recommended Posts
This topic is 7801 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now