I have a form that has many date fields. Let call them date1, date2 and date3. I have a field on top of the form called TotalDates, which is computed with @Trim(date1:date2:date3). I have a view that is categorized by TotalDates. I only want to show the fileds that are today in the view. I can separate all the documents that have at least date1 or date2 or date3 as today. The problem is if one of the fields is today, then all the fields in the document are shown in the category. I want to query in the view as the documents do not refresh every day.
Your choice of terminology is confusing me. I think what you’re trying to say is you only want to show a record if Date1, Date2, and Date3 are all today. That being the case, and since you said the documents do not refresh every day, you can put this in your view selection formula:
This is a really crappy way to do it. It will slow down view refreshes and the update indicator will always be displayed. A better way to accomplish this would be with a scheduled agent that sets a field you can use as a flag, then limit your view selection based on the flag:
Create a scheduled agent that runs at 12:05 AM:
@If(Date1 = @Today & Date2 = @Today & Date3 = @Today; FIELD Flag := “Yes”;FIELD Flag := “No”)
In your view selection:
SELECT Flag = “Yes”
Depending on how the dates are stored in the document you may have to play with @Date or @Text to get them to work. There are likely numerous other ways to accomplish this, and it is also likely I completely missed the mark. As I said, your terminology confused me so I may have misunderstood.
I am pretty sure I understand what you are saying. If any one of the dates is today then the document is shown in the view. But because you are categorizing the docs on the Totaldates field this same document will be categorized under each and every date in the field. What you need to consider is that your view selection is independant of your column formula. Because you only want to show documents from a single date you may as well not categorize the documents… but if you want to (for visibility reasons) then in your categorized column simply use @Date(@today).
Charles made some good suggestions regarding using @Today in the view selection that you should consider as well.
Thanks for both of you responses.The form is used for inspections.
The form may have an inspection for today, tomorrow and then next week for different reasons.
There maybe many inspections for today on different documents or many on the same document.
That is why the request to only show the documents with inspections for today, and not include the inspections on those document that are not for today.
That view is printed for the daily inspections for the inspector.
When I categorize on the field @Trim(Date1:Date2:Date3) I get a categorized line for any of the inspections on any document that has at leaset one date scheduled for today. I have been succesful in filtering out any documents that do not have any inspection dates for today.
I know this is confusing, but I think that by your responses you understand my question.