How To Create a Custom Query in a CQWP - caml

I am in the Content Query Tool Part, filtering my list with Managed Metadata Tags. My choices are "contains any of" and "contains all of". What I want is "does not contain", which is not listed. I am expecting the next input box in the CQTP, Custom Value or Query, will allow me to write a custom query against my MMT column for "does not contain". Does anyone have example syntax of what this query should look like for this input box?

Related

Is there a way to use an MS Access multiselect listbox control to filter records WITHOUT using VBA or iterating through the selected values?

I think the question speaks for itself, but I'll use a trivial example. Consider a table of salespeople as shown below:
Now consider a simple search/filter form with a list box where the user selects a region and it lists the salespeople in that region:
This is trivial. Assuming the list box is named lstRegionFilter, the query used to build the subform is simply:
select
[tblSalespeople].[SalespersonName] as [Salesperson Name],
[tblSalespeople].[Region] as [Region]
from
tblSalespeople
where
[tblSalespeople].[Region] = [forms]![frmSearchForm]![listRegionFilter];
Now consider the list box is changed to a multiselection list box, so that the user can select multiple regions with the filter working accordingly, as follows:
While this can be done, every solution I've found involves a VBA procedure that iterates over the list box's selected items, constructs a comma-separated string, and feeds this string to the result query. This strikes me as being more work than ought to be necessary, and I figure I'm missing a simpler "built-in" solution, that ought to look something like this:
... where [tblSalespeople].[Region] in ([forms]![frmSearchForm]![listRegionFilter]);
or perhaps
... where [tblSalespeople].[Region] in (select * from [forms]![frmSearchForm]![listRegionFilter]);
The reason I figure there must be a simpler solution is because using a multi-selection list box to filter records would seem to be the most obvious purpose for the very existence of the multi-selection list box control in the first place. As such, it intuitively seems that there would need to be a built-in way of extracting the list box's selected values directly as a record-set-style object that would be natively understood by an Access query.
So, to make a long story short, my question is this:
Is there a simple built-in way to do this without writing code to iterate over the list box's selected items?

SQL Select Statement Column Selection Based on Checkbox TickMark Access

I would like to select specific columns based on the user checkbox selection.
I can able to achieve it using VBA but is it possible to arrive the fields in SQL itself based on forms checkbox tick status?
Two ideas:
1) create a text box that collects the values of the checkboxes:
= if(checkbox1,"Col1, ","") & if(checkbox2,"Col2, ","") & ...
Create a second one that removes the tailing comma.
Use the content of this second text box to build your SQL string.
2) Solution 1 requires you to hard code the columns in one formula. A more generic way would be to populate a list with the column names of your data source (the table). The changed event of the list would then generate the list of column names for your SQL string.
This solution involves VBA, yes but it's interactive. Guess that's what you're after.

How to enter multiple user defined values on data Refresh in Business Objects

I am trying to run a Business Objects report in 5.1.9.
When I refresh the report it asks me in a box labelled "Enter and Select Values"
I can either enter a single free text value in the text box or I can type % to leave it unfiltered.
I would like to specify several values in this box rather than one or all. How do I do this? I have looked everywhere on google but perhaps I have the wrong search terms?
Wow - 5.1.9 almost 15 years old.
The box you're seeing is a prompt. Prompts can be defined either in the report's query, or in a universe object that's used in the query.
If it's defined in the query, then it's easy to change. Open up the query panel via Data -> Edit Data Provider (assuming you're using Full Client, WebI is a little different). You'll see the query panel with result object in the top-right pane and conditions in the lower-right pane. Look for a condition that includes the text you see in the prompt. That condition will likely have an "Equal To" operator. Change that to "In List", and the prompt should then accept multiple values.
If the prompt is not present in the conditions pane, then it is most likely applied via a universe object. If you want to make this change for this report only, you could modify the query's SQL (but only if you're using Full Client; for WebI, you'd need to modify the universe as described below). Hit the SQL button, and you will see the generated SQL. First, check off the "Do not generate SQL" checkbox in the lower-left of the dialog. Not doing so will cause your changes to be lost. Look through the SQL for a #prompt() function. Within that function, you should see mono -- change that to multi, and close the panel.
If you don't want to change the query's SQL, or if you want the change to apply to all reports, then you will need to modify the universe object that produces the prompt. You will need to access to Designer, and permission to import/export the universe. You will also need to locate the object that produces the prompt. Once you do, change mono to multi as described above, and export the universe.
Have you tried entering either of the following?
"FreeText1";"FreeText2";"FreeText3"
or
"FreeText1","FreeText2","FreeText3"
(obvs replacing FreeText with whatever your strings are)

MS Access context menu filter message The object doesn't contain the Automation object 'me'

I have a form that I open in either datasheet or continuous forms view with four fields bound to text columns in a linked table. If I right click for the context menu and filter on column 1 or 2 equal to one of the values it filters OK; If I try to filter on field 3 or 4 I get the message "The object doesn't contain the Automation object 'me'". If I select 'Text Filter' on fields 3 or 4 and enter some text, it filters OK.
I would be grateful if anybody that has experienced this can tell me why it happens and how to either trap or stop it.
Thanks
The problem is with Conditional Formatting on the columns. If I remove conditional formatting, filtering via the context menu works fine, replace the formatting and filtering shows the message (but still filters correctly!!)
This is an old post, but you are correct. I also discovered the cause of this error was incorrect Conditional Formatting. I kept getting an error on a form about "Object doesn't contain the Automation object [text box]". I couldn't find that [text box] anywhere. Then I realized I had Conditional Formatting on some of the fields. Sure enough, one of the Conditional Formatting rules was referencing this text box that apparently I had removed.

Searchable MultiSelect or the best approach

Users of a report have requested the ability to be able to manually enter a code, currently they are are presented a multiselect with all the codes related to the previous parameters.
This is in Report Builder 3.
This multiselect can become quite long so I thought another approach would be a searchable multiselect. Is this possible in any: way, shape, or form?
Could I allow for a cascading parameter (which is the code) to be either selected either through manual typing or another means.
I would add a type-in text parameter (lets call it Search_Code), with a default of % (assuming your data source is SQL).
Then in the data source for the Code list, I would add to the WHERE clause e.g.
WHERE Code LIKE '%' + #Search_Code + '%'
This will restrict the Code list to strings which partially match the Search_Code value (if entered).