If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > FileMaker > Date Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-28-06, 01:27
Nighthawk Nighthawk is offline
Registered User
 
Join Date: May 2006
Location: Dunedin, NZ
Posts: 4
Date Search

Hi all..

What I have is a date field, LastContacted and would like to make FMP to search for any dates that are over say 30 days or older from the current date and have them list on start up as a reminder... once contact is made or an email is sent the date is updated and shouldn't come up againt for another 30 odd days...

so my question is what is the formula for a date search to find all dates in that range.. i tried date ranges but it don't seem to work, and got myself confuddle i know can be done and must be pretty simple.. im just not that simple

Enter Find Mode []
Set Field ["LastContacted", formula I need"]
Perform Find []
Goto layout ["List']

Oh I am using FM5 (on windoze XPee)
Reply With Quote
  #2 (permalink)  
Old 06-02-06, 19:03
Nighthawk Nighthawk is offline
Registered User
 
Join Date: May 2006
Location: Dunedin, NZ
Posts: 4
Okay heres what I did as a work around it probably not the most eligent way...

Make a new global feild gTodayDate and in the startup script set with current date
In my settings database new field gContactReminder this way the user can set how many days.

New script in the last contacted

Code:
Enter Find Mode []
Set Field ["gTodayDate", ""<" & DateToText(Today-settings::gContactReminder)"]
Perform Find []
Copy ["gTodayDate""]
Enter Find Mode []
Paste ["LastContacted"]
Perform Find
if [status(CurrentError) <> 0"]
    Goto layout ["List"]
    Show All Records
    Perform Script ["Subscript", "ScreenRefresh"]
    Show Message "No Client needs contacting"]
    Exit Script
Else
    Goto layout ["List"]
    Sort ["Restore, No dialog"]
    Perform Script ["Subscript", "ScreenRefresh"]
    Show Message "The Following Clients need contacting"]
End if
I have taken it further and added that the user can select the clients that he wishes to be reminded on. Simply by adding a new field/ checkbox NeedsContacting and adding an extra step in the final search

Code:
Set Field ["NeedsContacting", ""Yes""]
As I said not the most eligent but it works ....
And yes I know version 8 it is easier but since I am in Ver5 I have to work with what I got
Reply With Quote
  #3 (permalink)  
Old 06-02-06, 22:26
<Ender> <Ender> is offline
Registered User
 
Join Date: Aug 2005
Location: Minneapolis, MN
Posts: 56
This is slightly better:

Code:
Enter Find Mode []
Insert Calculated Result [ LastContacted, "<" & status(currentdate)-settings::gContactReminder ]
Set Error Capture [ On ]
Perform Find []
If [ status(CurrentError) <> 0 ]
    Go to layout [ List ]
    Show All Records
    Perform Script [ Subscripts, "ScreenRefresh" ]
    Show Message [ "No Client needs contacting" ]
    Exit Script
Else
    Go to layout [ List ]
    Sort [ Restore, No dialog ]
    Perform Script [ Subscripts, "ScreenRefresh" ]
    Show Message [ "The Following Clients need contacting" ]
End if
Be sure that the LastContacted field is on the layout this script uses.
Reply With Quote
  #4 (permalink)  
Old 06-02-06, 22:57
Nighthawk Nighthawk is offline
Registered User
 
Join Date: May 2006
Location: Dunedin, NZ
Posts: 4
I tried that at first... In theory that should work... but I get showing all records...
Reply With Quote
  #5 (permalink)  
Old 06-04-06, 09:23
chriscozi chriscozi is offline
Registered User
 
Join Date: Apr 2004
Posts: 61
Date searching?

I know you specifically want a search in your question but why oh why use a find????

This is what Relational db's are all about and are excellent at achieving.

Just set up a self join relationship based on the 'last contacted' <= 'todays date' and voila, a portal contains the results.

Now ANYTIME there are out of date contacts they show in the portal. There are things you can do to have a HIGHLIGHT field show up on other layouts to show the status of these records, etc.

Because people may leave the application open longer than a day or so they won't run the script and your globals and scripts don't run.

What do you think? This is WAY more flexible, I would think.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On