February 11, 200322 yr Newbies 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
February 11, 200322 yr 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
February 11, 200322 yr 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
February 18, 200322 yr 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
February 19, 200322 yr 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.
February 19, 200322 yr 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
February 19, 200322 yr 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.
March 5, 200322 yr 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]
Create an account or sign in to comment