Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 3818 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

Hi, I'm very new to Filemaker Pro, and am just writing my first basic scripts for a project.  With a button,  I'm trying to filter my results to show me the records from the current week of the year.  My records are set up with a "Week" field that auto enters the current week number when new records are created. 

 

Now I want to have a button that shows me all the records from the current week and then display them on another layout.  I have this script working properly if I specify the week number in the Find request step, but I can't figure out the syntax to make it compare the current week number with the "Week" field in the records

 

Thanks in advance. 

 

Dana

Posted

Button script:

 

Go to Layout ["YourDisplayLayout"]

Enter Find Mode

Set Field[YourTable::Week; WeekOfYear(Get(CurrentDate))]

Perform Find

Posted

Read about "Finding Ranges of Information

 

To find a week of information, you will need to know what constitutes your week. Do you want Sunday thru Saturday, or are you looking for 7 days prior to today? 

 

Take a look at this custom function by Ocean West that you can find at Brian Dunning's site MagicDates

 

Lee

  • 1 year later...
  • Newbies
Posted

Lee,

 

Another newbie with a question about this older post... I've looked at the magicdates custom function. I'm curious how one would use it in a script to find records; I imagine it would be similar to what Doughemi has outlined in his example above but I believe that some changes would be necessary. 

Any immediate thoughts?

 

TIA. 

Travelindude

Posted

I'm curious how one would use it in a script to find records
 
It really depends on your specific application; keep in mind that the function is designed to allow users to input a variety of text phrases instead of typing a date range. If your script is supposed to always find records of the current week, then using this function would be an unnecessary complication.
 

 

 

 

My records are set up with a "Week" field that auto enters the current week number when new records are created.

 

I was away when this thread started, otherwise I would have commented on this:

This is not a good method to record the week in which a record was created. And it's certainly not a good place to search for records that were created in a given week - because such search would find records that were created in week X of any year. In addition, there's a problem of weeks crossing the year boundary, which I won't go into now.

This topic is 3818 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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