125 pts.
 What is wrong with this database search query?
searchStr =|FIELD Form =Form1  & FIELD CallsBeginDate >= | &  Trim(Cdat(doc.DeleteStartDate(0))) &  |  &  FIELD CallsEndDate <= | &  Trim(Cdat(doc.DeleteEndDate(0))) & | & FIELD Team =| & Trim(doc.OnCallTeam(0))&||

I have used with NotesDocumentCollection.

Thanks for any feedback

 



Software/Hardware used:
Lotus Notes Domino 7.2
ASKED: July 29, 2010  6:44 PM
UPDATED: August 3, 2010  8:01 AM

Answer Wiki:
Read up on the use of the FIELD keyword. It doesn't do what you think it does. Take it out of the entire formula. Also, I am not sure about if this is doing what you want "Trim(Cdat(doc.DeleteStartDate(0)))". You can test that by creating variables for testing and seeing what each part of this does - for instance, is doc.deletestartdate(0) a string that can be converted to date-time with Cdat? What does Trim take out of the converted date? If there is extraneous text that needs to be removed from doc.deletestartdate(0), it seems Trim should be applied inside of Cdat. Lots going on there that needs to be looked at, I would think. Finally, Before using a formula in a script, test it as a view formula. When you have a view formula that work, convert it for use in the script, subsituting variables as needed, as you are doing in this instance.
Last Wiki Answer Submitted:  July 30, 2010  1:12 pm  by  Brooklynegg   3,845 pts.
All Answer Wiki Contributors:  Brooklynegg   3,845 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Hi
You should use form name in quote like this :
searchStr = | FIELD Form = “Form1″ & FIELD CallsBeginDate >= | ….

and if “Form1″ is a variable it should be :
searchStr = | FIELD Form = “| + Form1 + |” & FIELD CallsBeginDate >= | ….

 4,075 pts.