Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Lotus Formula: Simple question on date Validation

Posted on 2007-08-10
6
Medium Priority
?
972 Views
Last Modified: 2013-12-18
Hi

I have to date fields which use the calendar time control, one is a Job In the other a Job Due Date, how do I set a field validation formula that prompts a user if he tries to enter an earlier date  in the Due Date field?

Many thanks
0
Comment
Question by:captain
  • 4
6 Comments
 
LVL 22

Accepted Solution

by:
Bill-Hanson earned 1000 total points
ID: 19669059
From the Designer Help:

"Dates can be compared and subtracted. Subtraction yields a numeric value representing seconds. To measure the difference between two dates in days, divide the result by 86,400, which is the number of seconds in a day."

So, your validation formula for the "JobDueDate" field might look something like this:

@If(
      !@IsDocBeingSaved;
            @Success;

      @Date(JobDueDate) - @Date(JobIn) < 0;
            @Failure("Job Due Date cannot be before Job In date.");

@Success)
0
 
LVL 31

Author Comment

by:captain
ID: 19669172
Hi Bill

Get the error "Incorrect data type for operator or @function", which is similar to what I tried using simple formula calcs earlier, do you think this is due to time control rather than using notes style.

Also this validation only runs on save I want this to run on input.

up with the points
0
 
LVL 31

Author Comment

by:captain
ID: 19669208
Hi Bill

oooooppppssss, typo in my field name, humble apologies.

Removed the first argument: so my formula is now:
@If(@Date(D_REQ) - @Date(D_IN) < 0;
            @Failure("Due Date cannot be before Job In date.");
@Success)

All hunky dory

Thanks
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 31

Author Comment

by:captain
ID: 19669406
Clarify to not get Time/Date expected error:

@If(D_REQ="";@Success;
@Date(D_REQ) - @Date(D_IN) < 0;
            @Failure("Due Date cannot be before Job In date.");

@Success
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 19672839
This also works,  a little simpler:
@If(D_REQ="";@Success;
@Date(D_REQ) < @Date(D_IN);
            @Failure("Due Date cannot be before Job In date.");
@Success)

And this is even simpler:
@IfError(
   @If(D_REQ < D_IN; "Due Date cannot be before Job In date."; @Success);
   @Success)
0
 
LVL 31

Author Comment

by:captain
ID: 19673055
Thanks qwaletee, this is good help for me to understand and learn about formula language.

I am sure be back with q's soon, watch my posts

All the best
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

564 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