Software Venture Consulting

FileMaker Pro downloads & Resources
FileMaker Custom Functions
FileMaker Web Viewer Examples
FileMaker Pro & Lasso Consulting
Training
FileMaker Books
FileMaker Articles
FileMaker Error Reference

Free Web Tools
Free FileMaker Tools

Personal Pages
Videos
Adventures
Links

Shopping Cart
Shopping Cart

Search:

Free Newsletter
Signup


Contact


Privacy Policy



FileMaker is a registered trademark of FileMaker, Inc. in the U.S. and other countries.

 

 FileMaker Pro Custom Functions

List  |  Show Random  |  Upload  |  Add This to Your Site

WeekRange ( TheDate )

Rate this function:  

RatingRatingRatingRatingRating
  Average rating: 4.5  (28 votes)
  Discuss this Custom Function

Ibrahim Bittar, Eikonsys
http://www.eikonsys.com

Gives the week date range (from monday to sunday) for a given date

Sample Input:
WeekRange ( Get (CurrentDate ) )
Sample Output:
11/07/2005...11/13/2005


 Then copy & paste into FileMaker Advanced's Edit Custom Function window.

Description:

This function returns the week range date for a given date. It´s ideal to search records for the current week.

For example: if today is 11/14/2005 and you want to find all the records in the week which 11/14/2005 belongs, you just have to use the function with the Get(CurrentDate) argument and it will return the week range 11/07/2005...11/13/2005.

You can use it in your search script using "Insert calculated Result" on any date field.

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

This is my Custom Function and I want to edit it

Discuss:

5 most recent comments | Show all 9 comments

Hi there,

Forgive my ignorance, but I have been trying to use this script and I just can't seem to get it to work. ive copied and pasted into my fmp, but not sure how to actually use this? could you possibly post a step by step? sorry to bother you with this.

richard, uk
June 01, 2018 6:00pm

Hi Richard

This is not a script. It's a custom function and in order to implement it into your solution you must have FileMaker Pro Advanced.

You need to copy the text on the box (the actual function calculation) and then:

1.- Select File > Manage > Custom Functions... menu
2.- Create a new Custom Function.
3.- Function name is: WeekRange.
4.- Add Date as a parameter.
5.- Paste the calculation you copied here.
6.- Save and close.

After that you'll be able to use this custom function as any other regular functions in your calculations.

Hope you find this useful.

Best regards

Ibrahim

Ibrahim Bittar, León GTO, Mexico
June 02, 2018 7:22am

Made a simple update:

1.- Changed parameter "Date" by "TheDate" in order to avoid confusion with the Date ( ) function.
2.- Changed spaces by underscores into the Let function, just for peace of mind :).

It's much better to get used to never use spaces in calculations, field definitions or table names because it's a mess with ExecuteSQL.

Best regards

Ibrahim

Ibrahim Bittar, León GTO, Mexico
June 02, 2018 7:28am

Hi Ibrahim, thank you so much for getting back to me.

Im trying to implement some kind of calculation that allows me to search for records within the current week. this seems to be the best one ive seen, and I can't work out anything better. I have used the following as a calculation

(Get (CurrentDate ) - DayOfWeek ( Get ( CurrentDate ) ) + 2) & "..."&
(Get (CurrentDate ) + 7 - DayOfWeek (Get ( CurrentDate ) ) + 1 )

This doesn't work when I search on a Sunday.

the custom function won't allow me to enter date as a parameter for some reason. Also, how do I use the Get (currentDate) function with this? sorry to be a pain but my head is going crazy trying to work this all out

richard, uk
June 02, 2018 8:00pm

Hi again Ibrahim, never mind I figured it out. I was doing it all wrong but thankfully with your help ive realised the error. thank you so much for this

Regards

Richard

richard, uk
June 02, 2018 8:17pm

Make a comment about this Custom Function (please try to keep it brief & to the point). Anyone can post:

Your Name:
City/Location:
Comment:
characters left. If you paste in more than 1500 characters, it will be truncated. Discuss the function - advertisements and other useless posts will be deleted.
Answer 8 + 2 =
Search for Custom Functions:

Custom Functions Widget
Download the Custom Function Dashboard Widget for OS X
Keep all the latest Custom Functions right at your fingertips!

Newest Custom Functions:

1. HexUUIDToNum_cf (_uuid)
  (Sat, Jun 16, 1:55pm)
2. httpResponseCode ( responseHeaders )
  (Tue, Jun 12, 10:40pm)
3. FindDuplicateCharacters ( string )
  (Fri, Jun 08, 5:01pm)
4. FieldRepetitionLast ( field ; maxRepetition )
  (Wed, Jun 06, 6:05pm)
5. CountModifiedRecords ( NameTimestampField ; StartTimestamp ; EndTimestamp )
  (Mon, May 28, 8:23am)
6. JSONArrayLength ( JSONArrayStr )
  (Fri, May 25, 7:46am)
7. interpolation (y1; y2; y3; x1; x2; x3; x1y1; x2y1; x1y2; x2y2; rnd)
  (Sat, May 19, 3:55am)
8. @JSONFormatElements ( json )
  (Tue, May 15, 3:31am)

RSS Feed of Custom Functions