?
Solved

Switch/case instead of If

Posted on 2004-09-21
8
Medium Priority
?
243 Views
Last Modified: 2013-12-18
This question is based on Q_21139033

Let's say I have 6 different "date/time" fields.

Some of them could be left blank.

In a view, I'd like a specific column to show the earliest date among the 6 fields...

So, is there a way to do a Switch/case thing in Lotus Notes??  Or should I make a big IF statement?
0
Comment
Question by:barbotte
[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
8 Comments
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 400 total points
ID: 12114500
maxy:= @adjust(@Today; 100;0;0;0;0;0);

mindate:= @subset(
    @sort(
        @if(@istime(field1); field1; maxy):
        @if(@istime(field2); field2; maxy):
        @if(@istime(field3); field3; maxy):
        @if(@istime(field4); field4; maxy):
        @if(@istime(field5); field5; maxy):
        @if(@istime(field6); field6; maxy)
    ); 1);

mindate

Unfortunately, works only in R6...
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12114531
But don't EVER do this in a view column, for it will make the view unnecessarily slow. It's better to add a field that does this computation when the document is saved.
0
 

Author Comment

by:barbotte
ID: 12114612
sjef_bosman , What does the first line mean?

Cos the dates in the 6 fields could be in 2008 or so!
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:barbotte
ID: 12114646
and...  What should I do if the database already have records in it?
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 12114658
Use @Sort if you are using R6

eg:

list := @trim(f1:f2:f3:f4:f5:f6);
Sort(list; [Descending])

~Hemanth
0
 

Author Comment

by:barbotte
ID: 12114906
Ok, sjef_bosman  solution works fine, thank you!
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 12116915
You CAN get OK performance out of the @Today by using an odl textttime of "Today" trick.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12120548
The first line creates a vraiable with a date 100 years from now, assuming you're not going over it. Astronomers do...
0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
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…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses
Course of the Month12 days, 7 hours left to enroll

777 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