Solved

View Selection formula doesn't work

Posted on 2000-05-06
5
213 Views
Last Modified: 2013-12-18
Hi,
I have a view that need to show all documents which Requested Date/Creation Date exceeds/equals to 60 days old compared to the current system date.

Here is my formula:
SELECT (form="Travel Request") & Status="Approved" & (@Today - @Date(TR_Date)) >= 60

However, it doesn't work at all.
I have a few documents which TR_Date is "02/05/2000", and yet they are showed in the view as well.

Is that anything wrong in my formula?

Thanks a lot!
0
Comment
Question by:kspuea
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 

Expert Comment

by:makerman
ID: 2786101
Hi!

Have you tried to compose your view formula in another way? I mean, why not do the counting in the form (in a hidden field) and then use that value in the view? For me it has worked just fine. What you need though is a scheduled agent that "changes" your field containing @Today formula.

Best regards,

Mira Å.
0
 

Author Comment

by:kspuea
ID: 2786759
Thanks, makerman.
But what I need is just to compare today's date with a Date field in the document. I don't want to change the field value.
0
 
LVL 3

Accepted Solution

by:
Simon_Hendry earned 20 total points
ID: 2786988
(@Today - @Date(TR_Date)) will return the number of seconds between the two dates your need to use

(form="Travel Request") & Status="Approved" & (@Today - @Date(TR_Date)) >= 5184000
0
 
LVL 3

Expert Comment

by:Simon_Hendry
ID: 2786998
Just to add to this though... Using @Today in your view selection formula means that your view index has to be calculated every single time you access the view ... You will probably notice that the "View Refresh Required" marker is always on for this view.. In a small database this is probably not a problem but if this database grows to any substantial size then opening the view is going to be very slow and the server update task is going to be doing alot of work....

A better solution to this is to create an agent that runs once nightly that checks the documents in the database that have (form="Travel Request") & Status="Approved"  and checks whether they are older than 60 days , if they are then it marks them with a field value ( say InView="Yes"  for example) .. Then set your view formula to be

(form="Travel Request") & Status="Approved" & Inview="Yes"

That way your view index will be static and your server will have to do much less work !!!
0
 

Author Comment

by:kspuea
ID: 2787676
Thanks a lot, Simon!!
That solved my problem now.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question