Bracketing AND/OR in filter
How do I write a query such that: If date > today AND (event type = 1 or event type = 2 or event type = 3) display my row? Today it evaluates as if the brackets are missing, so that event types 1, 2 and 3 appear in the view, ignoring date.
July 28th, 2011 10:35am

Are you just trying to create a new view of a list with the criteria above? Your question isn't quite clear on that, so I'm not sure if you're just trying to accomplish a filtered list view, or if you're writing a CAML query somewhere. If you are just trying to create a filtered view, you can do this in the properties of the view page. Go to the view you wish to edit: Click on the view name on the top right to display the drop down Modify this View Scroll down to the filter section Select the radio button for "Show items only when the following is true" In the first filter selection choose the date column you wish to filter on in the dropdown In the second dropdown select "is greater than" In the text box below it enter: [Today] (with the brackets) Under that select the "And" radio button Select the Event Type column in the first dropdown under where you clicked "And" In the next dropdown select "is equal to" Then type in your value of 1 Click "Show More Columns" Keep the default of "or" Select event type in the first dropdown Then select "is equal to" Then enter the value of 2 Click "Show More Columns" Keep the default of "or" Select event type in the first dropdown Then select "is equal to" Then enter the value of 3 Click OK I apologize if that's not what you're looking for. I figured I may as well post it in case that's what you're trying to accomplish.
Free Windows Admin Tool Kit Click here and download it now
July 28th, 2011 2:10pm

Melissa, Thanks so much. I was filtering a view. I tried the code you suggested, but it didn't work. I had to change it to this: Start is less than [Today] AND Event Type = 1 OR Start is less than [Today] AND Event Type = 2 OR Start is less than [Today] AND Event Type = 3Carole
July 29th, 2011 7:24pm

Hi Carole, I'm glad you were able to find your solution. Could you please post what version of SharePoint you are using (this will be helpful to others that come across your post looking for a similar solution). My solution above was tested on MOSS 2007 Enterprise. Thank you, Melissa Moderator Note: In these forums we assume MOSS 2007 or WSS 3.0 unless otherwise stated. (So I'm locking the thread as the OP has her answer)
Free Windows Admin Tool Kit Click here and download it now
August 4th, 2011 11:24am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics