Solved

Match today's date with dates in NotesDocument field

Posted on 2011-02-24
8
930 Views
Last Modified: 2013-12-18
Lotus Notes repeating calendar entries store their repeating dates in a field named RepeatInstanceDates.

With @Formula, I can use @IsMember to find if a value is in a list, but the members of RepeatInstanceDates are dates in the format 02/21/2011 05:15:00 PM CST, however I only want to match against the date portion, 02/21/2011.

Is there any way of doing this in the @Formula language?
0
Comment
Question by:jlalande
  • 5
  • 3
8 Comments
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 500 total points
ID: 34975839
I can't check right now, but I suppose the field RepeatInstanceDates contains a date value, not a string. Let's also assume your date x is a date value.

To check whether date x is in the field, try this condition (can be used in the query):
      @Text(x; "D0S0")=@Text(RepeatInstanceDates; "D0S0")
which is shorthand for
      @IsMember(@Text(x; "D0S0"); @Text(RepeatInstanceDates; "D0S0"))
0
 

Author Comment

by:jlalande
ID: 34976210
I've tried both and neither work for me.

If I already have the date in string format, is @Text(x; "D0S0") needed?  If not, what format should the date string 'x' be in?  I am assuming that D0S0 is a format argument.

Looking over this it looks like you are taking a list of dates and converting it to a list of strings in the format specified by 'D0S0', and checking if 'x' is in that list.
0
 

Author Comment

by:jlalande
ID: 34976292
BTW, I am working in C# using the Domino COM Toolkit.
0
 

Author Comment

by:jlalande
ID: 34976449
Actually, I think we're almost there.  I replaced 'x' with @Today and now get matches.  However, where I only have one repeating meeting today, I am getting four.

The other three are likely bookkeeping entries.  Is there a way to filter these out?
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

Author Closing Comment

by:jlalande
ID: 34976634
Actually, there were two repeating calendar entries for today.  I found a filter that works by checking if a field RepeatUnit exists using @IsAvailable.  This returns a valid set of calendar entries for today.

My complete query string looks like:

Form = "Appointment" & Repeats = "1" & (AppointmentType = "3" | AppointmentType = "2") & @IsAvailable(RepeatUnit) & NoticeType != "C" & NoticeType != "R" & @IsMember(@Text(@Today; "D0S0"); @Text(RepeatInstanceDates; "D0S0"))

Can you see anything that could be done better or faster?

Thanks so much!
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 34977748
Probably not much faster, but a little shorter:

Form = "Appointment" & Repeats = "1" & AppointmentType = "3":"2" & @IsAvailable(RepeatUnit) & !(NoticeType= "C":"R") & @IsMember(@Text(@Today; "D0S0"); @Text(RepeatInstanceDates; "D0S0"))
0
 

Author Comment

by:jlalande
ID: 34980328
I adopted your changes and added support for additionally getting today's non-repeating calendar entries, thereby completing the solution to retrieve all of the meetings scheduled for today, repeating and non-repeating:

Form = "Appointment" & AppointmentType = "3":"2" & !(NoticeType = "C":"R")
   & ((Repeats = "1" & @IsAvailable(RepeatUnit) & @IsMember(@Text(@Today; "D0S0"); @Text(RepeatInstanceDates; "D0S0")))
         | (!@IsAvailable(Repeats) & @Text(@Today; "D0S0") = @Text(STARTDATETIME; "D0S0")))

Please let me know if I have missed anything.

You've been a great help.  Thank you very much.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 34980634
Looks fine to me. You're doing an excellent job, sir!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

914 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now