Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Date Range Find


Suzanne
 Share

Recommended Posts

I was looking at the following postings to create a find date script: http://www.maclane.com/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=16&t=000104

 

This is the script I found:

 

Enter Find Mode []

Insert Calculated Result [“Date Field”, “DateToText(GlobalField1) & “...” & DateToText(GlobalField2)”]

Perform Find []

 

I have three fields:

AutoDate(this is the field on the page that shows the date of each record, it is formated as an auto generated date field and as the creation date and cannot be modified.

 

GolbalField1(format is global)

 

GlobalField2(format is global)

 

When the script called for the field "DateField" I used the existing field "AutoDate" on my page.

 

When I run the script I get funny numbers in the AutoDate field like this. 730710...731077 and the an error pops up that says The date range in this field must be a valid date in the range of years 1 to 3000 and should look like "12/26/1978".

 

It wants the proper date format. How do I get the number to show as a date instead of 730710...731077? The field is formated as an auto generated date.

 

Do I need to create another field? confused.gif

Link to comment
Share on other sites

Suzanne,

 

you will not need another field you will be pleased to know.

 

Are your global fields formatted as date fields?

 

This may be where your problem lies.

 

As long as all three fields are date fields the above should ( and does ) work.

 

How are your record numbers now by the way?

Link to comment
Share on other sites

Yes they are all date fields but the field "AutoDate" is not global. Should it be?

 

When you ask how my records look now? I don't understand. I went to see what would happend if I changed the "AutoDate" field to a global field but it just changed it into a date field without the automatic date entry and I don't want that.

 

Suzanne

Link to comment
Share on other sites

Suzanne,

 

OK, all date fields. That is fine. And no, the Auto Date should not be a global.

 

As to the how are your records now, I meant from the previous post and emails you had sent me (If indeed you are that suzanne blush.gif ) If you are, did the email I send help out with your record count problems.

OK, dates.

 

Make sure that ALL the fields are on that layout.

 

Let me know if not, then we can look at again.

Link to comment
Share on other sites

Yes I am that Suzanne. And thank you it's working fine (the last one that is). As for the Global calculation you had suggested for found and unfound records and the number count I am using those calculations.

 

I think FileMaker makes it's own rules as it goes along. Like with the above mentioned calculation for found records etc. I had thoses calculations as individual scripts in the second database. When I called them to work in the script individually from the second database they didn't want to.

 

What I had to do is make a script in the first database that called all three calculations from the second database then add it as a sub-script to the script you had helped me with which was located in the first database. Do you see why I find that strange? What's the difference if the main script is calling three seperate external scripts, or the main script has an internal sub-script that calls the three seperate external scripts? Whatever it is FileMaker knows the difference.

 

Anyway back to my date range find. What do you think the reason is that it's not plugging in a properly formatted date? They are date fields.

 

Suzanne smile.gif

Link to comment
Share on other sites

I think I have the fields confused. I’ve redone the script in two different ways and still it won’t work. I have three fields the date field ( I call “AutoDate”) this field is formatted as a date and to be auto generated each time a record is created. I then have two global fields (“GStartDate” and GEndDate”) these are formatted as a date too and I do not have the box that says – no repeating fields.

 

When I run this script I get the message “no records can be found”. When I know there are in fact records between the two dates I entered.

 

Enter Find Mode[]

Insert Calculated Result[“AutoDate”, “Date To Text(GStartDate) &”…”& Date To Text(GEndDate)”]

Perform Find[]

 

When I run the script below the screen freezes in find mode with the curser in the “AutoDate” field with the numbers 752639…731089 and the message -The date in this field must be a valid date in the rage of years 1 to 3000 and should look like “12/25/1997”. I thought that I could I have the date formatted incorrectly for the function? I had my date formatted as custom – Thursday, December 25, 1997 without leading characters. I then changed the date format for all three fields to format as 12/25/1997 and it still gives the same message. What could be wrong?

 

Suzanne

 

Enter Find Mode[]

Go to Layout[‘Contact”]

Insert Calculated Result [“AutoDate”, “GStartDate” &”…”& GEndDate”]

Perform Find[]

 

Suzanne Lenora

Link to comment
Share on other sites

I do see bold under text format. I changed all three text format styles to plain and it still tells me the date isn't formatted correctly. It's probably really something in my face wrong.

Link to comment
Share on other sites

Ok I got this script to work!

 

Enter Find Mode[]

Insert Calculated Result[“AutoDate”, “Date To Text(GStartDate) &”…”& Date To Text(GEndDate)”]

Perform Find[]

 

But not the other one. I only need one and I have no idea what I am doing so my guess is that it a good one!

 

They do the same thing right?

 

Thank You Andy!! wink.gif

Link to comment
Share on other sites

 Share



×
×
  • Create New...

Important Information

Terms of Use