Newbies Jake Posted February 11, 2003 Newbies Posted February 11, 2003 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
Garry Claridge Posted February 11, 2003 Posted February 11, 2003 You could have a Calculation field which calculates the age of the record in days. Then test against that field. Or, use some Javascript to calculate the target date. All the best. Garry
Pupiweb Posted February 11, 2003 Posted February 11, 2003 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
Steve T. Posted February 18, 2003 Posted February 18, 2003 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
Unable Posted February 19, 2003 Posted February 19, 2003 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.
Steve T. Posted February 19, 2003 Posted February 19, 2003 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
Vaughan Posted February 19, 2003 Posted February 19, 2003 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.
Steve T. Posted March 5, 2003 Posted March 5, 2003 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]
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now