Manage Learn to apply best practices and optimize your operations.

Spotting late dates in a view

This tip describes how to identify a date past due in a view.

You Can View User Feedback To This Tip

Recently I was asked to develop a project management tool. A major part was a view showing project progress, in particular any "late running" projects.

Projects were broken down into milestones (which had target dates), so each project document had the possibility of having many target dates.

My problem was how to spot a late project from many dates, within a view?


I started off with a massive @if statement, comparing dates and complete fields, which caused all sorts of problems + I knew it was extremely inefficient.. I finally came up with the following code:

Dates:=@trim(@text(@if(Complete_0="Yes";"";@if(Complete_1="Yes";"";Date_1):@if(Complete_2=
"Yes";"";Date_2):@if(Complete_3="Yes";"";Date_3):@if(Complete_4="Yes";"";Date_4):@if(Complete
_5="Yes";"";Date_5):@if(Complete_6="Yes";"";Date_6):@if(Complete_7="Yes";"";Date_7)
:@if(Complete_8="Yes"
;"";Date_8):@if(Complete_9="Yes";"";Date_9):@if(Complete_10="Yes";"";Date_10):
@if(
Complete_11="Yes";"";Date_11):@if(Complete_12="Yes";Date_12;"")));
TDay:=@today; @if(Dates="";0;TDay>@texttotime(Dates);84;83);

The code creates a list of valid dates (Dates), removes the whitespace/blank entries and compares it to todays date. If one or more fail (ie. date is in the past), the down thumb icon is shown.

USER FEEDBACK TO THIS TIP

  • This might be a good tip, if we knew the structure before jumping into the code. How many date fields are there, what are their names, or are all dates store in one field... we need to know what the options are before we get thrown into the solution. That was very confusing and to test it on my end, I don't know how many fields to put on the form, named what and what data type they are. Need more details.—Ruth Inman

This was last published in December 2002

Dig Deeper on Domino Resources - Part 4

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchExchange

SearchContentManagement

Close