×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Date Validation where variable represents the date

Date Validation where variable represents the date

Date Validation where variable represents the date

(OP)
Hello, I am building a subscription database for a quarterly publication and need to be able to identify records for expiring subscribers. The database contains a field for ending issue but the issue is identified by season and year ie. "Summer 2007". How can I specify that "Summer 2007" equals a specific date or date range without renaming the values in the field? I am trying to create a script that will identify only expiring records. Please help if you can, I am a graphic artist & web designer by trade and this database stuff is new to me.

RE: Date Validation where variable represents the date

Well, first you'll have to decide what your universe of text-based dates are, and when your seasons start and end, but after that it's not that tough.  

Let's say, for example, you want to identify all your entries marked as "Summer 2007" with an ending date of August 31, 2007.  First, make sure you've created a new field with a Date data type to hold the resolved date, then create a script that does this:

Show All Records
Go to Record/Request/Page [First]
   Loop
     Set Field [date_field; Case( text_based_date_field = "Summer 2007", "8/31/2007"; text_based_date_field = "Spring 2007", "6/30/2007"; text_based_date_field = "Fall 2007", "10/31/2007")
     Go to Record/Request/Page [Next, Exit After Last]
   End Loop

---------------

BTW, I never string my case functions together on one line (they're harder to read that way, I just did it so that the calc looks the way it should look in your Scriptmaker ... the unmashed version should look like this:

Case(

text_based_date_field = "Summer 2007", "8/31/2007";
text_based_date_field = "Spring 2007", "6/30/2007";
text_based_date_field = "Fall 2007", "10/31/2007"

)

RE: Date Validation where variable represents the date

(OP)
Thanks CryoGen, works great.

One more question, now that I have converted my text_based_date_field to dates how do I get Filemaker to compare the last issue date to the current date and display expired records?

RE: Date Validation where variable represents the date

It depends on where you store your last issue date.  Assuming that last issue date value in the same row in a different field, you could write a calculation field that resolves that as well.

Create a calc field with a text data type, then use an IF statement to do the comparison:

If ( new_date_field >= last_issue_date, "Expired", "Current")

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close