Jump to content

Thom

Members
  • Posts

    106
  • Joined

  • Last visited

Thom's Achievements

Enthusiast

Enthusiast (6/14)

  • Conversation Starter
  • First Post
  • Collaborator
  • Week One Done
  • One Month Later

Recent Badges

0

Reputation

  1. Make your relationship sorted by progress_report_date in descending order - latest first. You can do away with the Max() function; project id from progress reports::progress_report_date will be the latest automatically. Likewise, project id from progress reports::next_step will also be from the latest report.
  2. I'm using FM5.0v3, and all months for 2002 calculate correctly. I can send you a demo, if you'd like.
  3. You're not alone. It's a bug in the UBB software. I complained earlier to no avail. Try posting this without UBB code tags: code: <( This is a common occurance in calculations. For example: code: If(a < (b + c), "true", "false")
  4. If you use a separate layout for finds, then you can format the field as Radio buttons or a Pop-up menu, using a new value list: Y = Selecting the = in Find mode will be the same as typing = in a plain text field. I suppose you'll still need to script the find to move from the viewing layout to the search layout and back.
  5. Why not let FM worry about leap years, etc.? Shorten the month number calc to this: code: monthNumber(calc,number) = ( Position ( "JanFebMarAprMayJunJulAugSepOctNovDec", Left(monthName,3),1,1 ) + 2 ) / 3 Create a calc to find the number of the first day of the week of the month (Sunday = 1, Saturday = 7) code: firstDayOfWeek(calc,number) = DayofWeek(Date(monthNumber, 1, year)) If you'd like to show a few days from the months before and after the current one, use this pattern for calendar days 1-6 and 29-37 (you can use it for all 37 (or 42) days, really) code: sun1(calc,number) = Day(Date(monthNumber, 2 - firstDayOfWeek, year)) mon1(calc,number) = Day(Date(monthNumber, 3 - firstDayOfWeek, year)) tue1(calc,number) = Day(Date(monthNumber, 4 - firstDayOfWeek, year)) ... If you'd prefer to show numbers for the current month only, use this for days 1-6 and 29-37: code: sun1(calc,number) = If(Month(Date(monthNumber,2-firstDayOfWeek,year)) = monthNumber, 2 - firstDayOfWeek, TextToNum( "" ) ) mon1(calc,number) = If(Month(Date(monthNumber,3-firstDayOfWeek,year)) = monthNumber, 3 - firstDayOfWeek, TextToNum( "" ) ) tue1(calc,number) = If(Month(Date(monthNumber,4-firstDayOfWeek,year)) = monthNumber, 4 - firstDayOfWeek, TextToNum( "" ) ) For calendar days 7-28, use this pattern: code: sat1(calc,number) = 8 - firstDayOfWeek sun2(calc,number) = 9 - firstDayOfWeek mon2(calc,number) = 10 - firstDayOfWeek The number in the field name represents the week, or row, of the calendar. You don't need it for this calendar, but here's an easy way to find the number of days in a month: code: monthLength(calc,number) = Day(Date(monthNumber + 1, 0, year))
  6. Use the Max() function: maxNum(calc,number) = Max(field_1, field_2, field_3)
  7. That's how the auto-fill option works. Once the field gets auto-filled, the value won't change. You have to manually delete the value for a new one to auto-fill. Try changing the field type to Calculation. The value of a calculation field can change when any of it's constituent fields change.
  8. The following perfectly valid calc generates an error on this BB, unless it's surrounded by UBB code tags: code: a < (b + c)
  9. Unstored calcs are good for printing, bad for searching. Each find has to build a new index. With lots of records, this can get very slow. Make a calc that shows a 1 if the item as been returned, 0 if not. code: Case( IsEmpty(dateBorrowed), TextToNum( "" ), IsEmpty(dateReturned),0, 1 ) Have your search script insert the current date: code: Script: Find Overdue Go to Layout [search layout] Enter Find Mode Set Field [isReturned, 0] Insert Calculated Result [dateDue, "<" & DateToText(Status(CurrentDate))] [select entire contents] Perform Find Go to Layout [results layout] It sounds like you are experiencing architectural difficulties. You should have separate files for ITEMS, BORROWS, and BORROWERS. Each file needs a uniqe id field. The BORROWS file should have fields for itemID, borrowerID, dateBorrowed, dateDue, dateReturned, etc. You could also add a field to record in what condition an item was returned.
  10. I just spent some time writing a description of a solution, including some calculations. When I tried to submit it, I got a page telling me about some nonsensical problem with parenthesis in HTML. When I tried to go back to see what the problem might be, my message had been wiped out. The following, if not in UBB "code" tags causes the error: code: quoted string "<(" Is this something you can fix? [ February 05, 2002, 12:43 PM: Message edited by: Thom ]
  11. If you use field validation, you can lock individual fields on a per record basis. Then you don't need to switch layouts or worry about locking all records when you only wanted to lock one (and vice versa). Using lookups or auto-enter, you can cause fields to lock automatically after data has been entered. You can unlock those fields by clearing the lock field(s) with a script.
  12. Yes, Stephen, this thread is NOW in the wrong forum (Using FileMaker Online).
  13. You could use some portals and reduce the number of scripts to one per portal. Another approach is easier to setup, requires one script, and two clicks per number.
  14. If I understand your scenario, you have a field called 'type'. The values in 'type' come from a value list with 3 values. Some records have "faculty", some have "staff", and some have "secretarial". For each type you want to know how many records there are. Correct? Create a Summary field called 'typeCount' with a count of 'type'. Create a new layout that's a columnar list/report. Select Report with grouped data. Under Specify Fields, choose 'type' and 'typeCount'. Under Organize Records by Category choose 'type'. Leave Sort Records with 'type' selected. Sort the found set by 'type', then view the new layout in Preview mode. There are other ways to do this that work in Browse mode, but the fields become very slow to display when you have many records.
  15. You should NOT change the invoice date field to text. Searching for a range of dates will not work on a text field, unless the dates are formatted as YYYY-MM-DD with leading zeroes for single digit months and days. Insert Calculated Result[] works well, but the date field must be on the current layout. Set Field[] will not work, because a range is not a valid date. Try the following script (the data type of all fields is date): Go to Layout[layout with invoiceDate field] Enter Find Mode [] Insert Calculated Result[select, invoiceDate, DateToText(gDate1) & "..." & DateToText(gDate2)] Pause[] Perform Find[] Go to Layout[display results layout] The script expects that the user has entered dates in gDate1 and gDate2. The Pause[] will stop the script so that you can confirm that the date range is entered properly in invoiceDate. Once you see that the script works, remove the Pause[] step.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.