mlindal Posted April 5, 2001 Posted April 5, 2001 I need help with a date query in CDML I have a 'dateadded' field in the FM4 database and I want to have the web page display new records in the last 30 days. Without using a script how can this be done directly in CDML ie) dateadded > currentdate - 30 I have tried <a href="FMPro?-db=database.fp5&-lay=forweb&-format=hitlist.htm&-error=error.html&dateadded>[FMP-currentdate]-30&-sortField=dateadded&-sortorder=descending&-find"> I am also wondering about the -op=gt function and if that might be the clue. Any help would be appreciated and if this is not possible in CDML - let me know as well. Cheers!
Anatoli Posted April 5, 2001 Posted April 5, 2001 In URL you cannot use math expressions; the .gt. will work, but the > is way off required URL handling. [ April 05, 2001: Message edited by: Anatoli ]
Vaughan Posted April 6, 2001 Posted April 6, 2001 Do the work in the database. Make a calc field that does the work: make a field named "expire" where expire If[ (Status(CurrentDate) - dateadded) > 30, "1", "0"] Now perform a search for expire=0.
mlindal Posted April 6, 2001 Author Posted April 6, 2001 All right I figured the '>' needed to be replaced by .gt. But... what is the code to get this function into cdml on my web page. dateentered > (currentdate-30) would it look like this? &dateentered.gt.[fmp-currentdate] Arrgh now how do I get the minus 30 day??? help -- this should be easy.
mlindal Posted April 9, 2001 Author Posted April 9, 2001 Thanks Vaughan, As always you are right to the point. I had figured I would have to create a calc field and do it in Filemaker - but just wish there was more power to do these calculations directly in CDML.
Anatoli Posted April 9, 2001 Posted April 9, 2001 My 2 cents. You will discover the real Power of FM on web, when you will combine the powers. FM + WebCompanion (or Lasso) + HTML + CSS + JavaScript for start. I am almost tempted to recommend Switch from FM Client to Web Browser in some cases.
Recommended Posts
This topic is 8698 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