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

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

Recommended Posts

Posted

I have a auto enter field that enters the creation date.... I need a script that I can run that will find the all records for the previous month .... so if I ran it today it would find all records created in March, If I ran it in June it would find all records entered in May,,, ect...

: confused.gif :

Posted

Hi,

IMHO, you don't need a script to do that but a Range calculation based on :

1. A. A start date (your creation date)

2. B. A end date (Status(currentdate)

3. C. A value list of all dates from your file based on field A

Then, the calculation would use MIDDLE(POSITION,....) , but you may also hae a look to Bob Weaver DateRange3.fp5 available in the Atachment section.

Posted

Ok ... IMHO?: ...-... Could I get a link to that post, I can't seem to find it... this whole thing makes no since to me .... could somebody please explain it to me a little bit please

Posted

It is easy with a script and there is no need to do it the hard way with relationships and calculating multi-keys.

Script is:

Enter Find Mode [ ]

Insert Calculated Result ["CreationDate", "DateToText(Date(Month(Status(CurrentDate)) - 1, 1, Year(Date(Month(Status(CurrentDate)) - 1, 1, Year(Status(CurrentDate)))))) & "..." & DateToText(Date(Month(Status(CurrentDate)), 0, Year(Status(CurrentDate))))"

Perform Find [Replace Found Set]

You can just copy formula from above into your script window and it will always work for finding all records from previous calendar month.

Posted

OOps...

Sorry, I was focused on the "range" and imagined you needed a Multikey. There are so many posts in theses days about range of dates that I misread this post.

So the more script you have, the better you'll get wink.gif

  • 1 year later...
Posted

Hello, I am new to this place so please bare with me. I have a similar problem in that I am trying to query records for a certain month as well as all months in the current year (year to date). Can anyone help me? I am currently using the field Last Action Date for my query.

Posted

To perform your query in find mode, you need to specify a date range using "...":

1/1/2004...//

will find all dates between Jan 1, 2004, but less than or equal to today's date ("//" stands for today, FileMaker will provide the correct date automagically when the query is run)

You can perform a similar range to find over an entire month:

3/1/2004...3/31/2004

If you need to automate these things in a script, then you need to look into calculations to build them up, as shown in plechton's post.

Posted

I'm hoping someone can help me with what may be pretty simple operations.

First, I need to create a script that will yield all records for the current year to date. I need a script that will use the "Last Action Date" field and query all records for the current year.

So if I'm in May 2004 it will give me Jan-May 2004 records.

Second, I need to create another script that will give me all records for a certain month in the current year. I've already created the query for each month i.e.

"Enter Find Mode []

Insert Text [select, "Last Action Date", "01/01/2004...1/31/2004"]

Perform Find [Replace Found Set]

Sort [Restore, No dialog]

But how can I modify this so that it will always give you the month for the year you are in so I don't have to change the year for next years records?

Thanks in advance for any help you can give me!

confused.gif

Posted

Enter Find Mode [ ]

Go to Layout [{one containing LastActionDate field}]

Insert Calculated Result [LastActionDate, DateToText( Date( 1, 1, Year(Status(CurrentDate)) ) ) & "..." & DateToText(Status(CurrentDate))

Perform Find [ ]

Enter Find Mode [ ]

Go to Layout [{one containing LastActionDate field}]

Insert Calculated Result [LastActionDate, DateToText( Date( Month(Status(CurrentDate)), 1, Year(Status(CurrentDate)) ) ) & "..." & DateToText( Date( Month(Status(CurrentDate)) + 1, 0, Year(Status(CurrentDate)) ) )]

Perform Find [ ]

Posted

I want to be able to sort records for example (by month) I've got a script to a button to do this but I thought if I used a Value list then the value chosen would stay viewed so you would know what search you had performed. Plus it seems cleaner than a ton of buttons. Yes, I'm sure I could enter the month in find mode but I'd like to automate this for the less technical people who will be using this report.

Posted

I'm not sure what you mean by the value chosen would stay viewed. If you need a field to hold the value of the current month or month selected, you could set a global text field in the script and display this field on your layout.

I'm still somewhat unclear on the question.

Posted

OK, just when I thought I had figured this thing out, alas, it is driving me crazy! Does anyone know how to set the page setup/print features for each layout in a database so that one will ALWAYS print 8.5 x 11 portrait - current records, and another one will ALWAYS print 11 x 17 landscape - browsed records? I really wish FileMaker would come out with a solution to this lack of functionality. I have set up the pages in the format I want them in, then created a script and that seemed to work for awhile but then all of a sudden they all go back to letter size.

Thanks a bunch!

P.S. Thanks Queue for the Year to Date Script.Worked like a charm~!!!

Posted

You can create script and specify the print setup "and" print property with different settings for paper types and for records type.

Posted

I think perhaps your confusion is due to the fact that page setup is script-dependent not layout-dependent.

You need to create scripts for each possible setup that you would use. The easiest way to do this is to first manually perform a setup and print, then create the steps in a script. Now, unless you reopen the script, click OK, and select 'Replace' for the page setup, the script will maintain the settings you've just specified. You can then perform a different type of setup and print and create a script or add the steps to another script.

Note that only one setup/print settings can be saved for each script.

If you want to change the settings for an existing script, do as described above: manually perform the setup and print, then open the script, click OK, and select 'Replace' for the setup.

Now you can create a button for each layout you want to print, and attach the correct script to it. Or you can call the desired script from another script.

  • 3 weeks later...

This topic is 7474 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.