Jump to content

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

Recommended Posts

  • Newbies
Posted

Hi All,

Been mulling this one over for a while and can;t find the simple solution. I have a "Date Created" for all records in the database. I'd like to create a button on my site where people can just click and see the latest 30 records?

So I'd do something like:

<input type="hidden" name="-op" value="gte"

<input type="text" name="Date Created" value="???">

How can I create a value for a date 30 days ago?? I do not want to call a script from the web. Is the answer going to be a simple javascript to create the value? Or is there an easy method?

Thanks

Jake

Posted

I think

<input type="hidden" name="-op" value="gte"

<input type="hidden" name="Date Created" value="[FMP-currentdate]">

<input type="submit" name="-find" value="Find last month">

should do

Posted

Hi, Jake! Actually, I had done exactly what garry described and it works great. I created calculation fields (unstored) called thisday, tomorrow, in7days, and in30days and just perform searches based on those. Here's some of my code...

<INPUT TYPE="hidden" NAME="-op" VALUE="gte">

<INPUT TYPE="hidden" NAME="fieldname" VALUE="[FMP-field:thisday]">

<INPUT TYPE="hidden" NAME="-op" VALUE="lte">

<INPUT TYPE="hidden" NAME="fieldname" VALUE="[FMP-field:in30days]">

This searched inclusively for dates from that same day up to 30 days hence.Of course, I also had sort criteria and stuff but that's the basics. The calcuation fields in FMP are very easy...

thisday=today

in30days=today + 30

Hope this helps! --ST

Posted

I may be wrong on this, but instead of using today in your calculation you may be better off using Status(CurretnDate). Last I knew this had to do with restarting FMP (or not) once a day.

Posted

Hi, Unable! Thanx for the warning and I do seem to remember something about when to use Status(CurrentDate) vs. today, but today seems to be working OK for me without restarting FMP. Maybe it was version-specific or something and they fixed it... I'll keep an eye on it, though!

Thanx.

--ST

Posted

Leave FMP running for a couple of days. Then see if everything's still OK.

Today only recalculates when FMP first starts. After 24 hours the calc resuts will be incorect.

  • 2 weeks later...
Posted

Hi, Vaughan/Unable! You were both right about TODAY. I forgot I had been rebooting the server everyday automatically in Mac OS 9. When I moved to X, it was not calculating correctly.

thisday=Status(CurrentDate)

tomorrow=Status(CurrentDate)+1

etc.

These work better. Thanx. [Public FYI: unstored, global]

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