SSRS 2012 - Sending multiple values in parameter to main dataset - visual-studio-2012

I have a report that is up and running but I need to restrict the data on a parameter that takes multiple string-valued staff codes.
I created a parameter called Practioner which is a text type, ticked on Allow Multiple values and also on Visible.
In the available values, I made this code come from the field called mbillaty from the dataset3 under the Get values from a query option. I've checked data3 is fine in SQL server.
3.Now, I've gone to my dataset1 where all the reporting data sits then put the parameter, with the name ? and =Join(Parameters!Practitioner.Value,", ") for the parameter value. Then in the query, in the where clause, I've put: ......mbility in (?)
What should this SSRS be interpreting as is : .......mbility in ('AAB','KKR','RDR'), if the user picked these three staffs.
When I run the report, it definitley works when I check one of the practioners, but as soon as I more than one, the report wouldn't run. It does not return any error, but just the header shows, which I think means that no data is found.
Experts, do you see where I've gone wrong with this?
Thanks

If you're able to create UDFs, this link might be helpful. How do I split a string so I can access item x?
The parameter would be parsed in the SQL/function, and SSRS would simple pass the concatenated string.

Related

Creating report based on input form in MS Access

I am currently developing a database to monitor my employees' work. Yet, MS Access is new to me and I encounter a fundamental problem when creating reports.
I wish the system can generate reports based on the values of an input form. Say, I would like to check Peter's work in January, I could simply enter:
Name: Peter
Month: January
Then the Access would be able to generate a corresponding report. But I am not sure how it works. And I am thinking of three possible approaches.
(1) Input form -> Query -> Report
I look up youtube and learn how to build an Access form that passes a parameter value to a query. And then I can click the Create Report button.
(2) Input form -> Report
Not sure it works or not. But I learned a bit VBA which may be helpful in this case.
(3) Export to Excel
Export to Excel might be a good option. I can use various functions and filters to select the information I want.
Sorry that my question is being abstract. Any help is appreciated.
there are many ways you could achieve this.
One way (it may be the most efficient or not depending on your query / data you need to output in the report).
Build the query.
Build a report with its record source based on the query.
Build a form with input controls and a button.
With the button you are going to open the report. In the open statement of the report you are going to specify the controls as filters to some of the fields retrieved by the query.
Example:
Private Sub POrdine_Click()
On Error GoTo Err_POrdine_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "EmployeeWork"
stLinkCriteria="EmployeeCode=" & Forms![frmNameOfForm]![cboEmployeeCode] & " AND WorkMonth=" & Forms![frmNameOfForm]![cboWorkMonth]
DoCmd.OpenReport stDocName, , , stLinkCriteria
Exit_POrdine_Click:
Exit Sub
Am assuming the two comboboxes are going to pass a numerical value, the employee code (which would be a primary key) and the value of the month. Build the queries that feed these controls so that you may see the employee name and the month name. If in doubt just ask.
Notice how this approach may not work well for reports based on large amounts of data.

Access Subform Datasheet Only Returning 1 Result

I know this question has been asked multiple times in some form or fashion, but I'm not been able to find a solution that works and it's driving me crazy. I'm creating a search form in Access that executes a select query via VBA to find data that is in a table. So far this has been pretty straight forward, the query works, and the form returns results. The issue is that I'm using a subform to return/display the results and it is only returning one result at a time.
I used the setup wizard to add the subform to the main form and I linked the two forms during that process. I have the subform being displayed as a datasheet, but even if I change it to a "continuous form" it still just returns one record at a time. I have my subform's Record Source set as my Select query (Select * From tbl_Search) , and I've set the Record Source for my main form to just about anything I can think of (Select query, table, nothing...).
I know there has to be a way to return all the records in one datasheet without having to continuously click the next arrow, but I have yet to figure out what that way is.
Since this isn't an issue with the code per se, I wasn't sure what kind of images or code blocks might be necessary to answer this question, so i tried to be as descriptive as possible. If there is a chunk of code or screenshot that you need to help answer this question, just let me know.
Your main form should be unbound. Create a search query and set it as the subform's recordsource. You can pass the main form's fields as parameters to the query, for example:
PARAMETERS [Forms]![YourMainForm]![YourTextField] Text (255);
SELECT *
FROM YourTableName
WHERE ((([FieldName)=[Forms]![YourMainForm]![YourTextField]));
The only thing you have to do when running a search is to .Requery the subform.
Me.SubformName.Form.Requery

Data Parameter in Excel not working with Access Query Connection

I have a connection to an Access DB query within Excel. The field in the Access query is an expression turning a field into a proper date. The problem that I'm having in Excel lies within passing the parameter from a cell containing the date that I want the query to run for. The results are either completely wrong or result in nothing. I have tried modifying the parameter cell to just about everything to no avail. I have tried the edit query option under view connection and when prompted to put in the value for the parameter, it actually returns the data I want. I would thing that this would be exactly the same parameter it would be grabbing from the formatted cell?
I have attached my connection's SQL command text below. And also an image with more detail and screenshots.
This is the command text from Excel containing my Where clause:
SELECT Query1.SETYPE, Query1.`SEORD#`, Query1.ORBILL, Query1.ORCUST, Query1.ORLDAT,
Query1.ORCONS, Query1.SESEV, Query1.CMTYPE, Query1.CMTEXT, Query1.ORDDATfix
FROM `C:\USERS\DRED\DESKTOP\ServiceFailures.accdb`.Query1 Query1
WHERE Query1.ORDDATfix =?
SELECT Query1.SETYPE, Query1.`SEORD#`, Query1.ORBILL, Query1.ORCUST, Query1.ORLDAT, Query1.ORCONS, Query1.SESEV, Query1.CMTYPE, Query1.CMTEXT, Query1.ORDDATfix
FROM `C:\USERS\DRED\DESKTOP\ServiceFailures.accdb`.Query1 Query1
WHERE (Query1.ORDDATfix>=?)
Apparently putting the clause in parenthesis fixed the problem.

Can you make columns optional for SQL Insert Row in Azure Logic Apps?

I am using the Logic App designer on Azure. Added "SQL Azure - Insert Row" as an Action, it prompts me to insert values for the columns but all the columns are marked as required and it doesn't save the changes/sequence if a value is not entered there.
Is there anyway of bypassing this or making the columns optional?
I tried this previously, there was no way to make the columns optional but i figured a workaround.
First, in the designer put any value, then open Code view and look for the columns you don't need and just delete it from the JSON schema and hit save :)
that should do it for you, but next time you open in designer and try to edit you have to do this again.
let me know if it helps
Edited
I added a screenshot of the steps that i made while trying to replicate this. (note that your database schema should handle these null values for the columns, in my case the Guid had a default value of newid() and the other column allowed nulls). You always pass null to the columns, not passing values at all might make sense for columns that has values computed or has default values (like newid() uniqueidentifier or getdate() for created/modified time)

Append Query From Access Into Linked SharePoint List with Lookup Fields in SP List

I am trying to append records in an MS Access table (I am using Access 2010, but can use 2007 if need be) into a linked SharePoint list.
There is an attachments field (when viewed from Access), but I am not concerned with appending these.
The SharePoint list has a few lookup fields, that in design view are of the Number format. Upsizing to SQL Server, I can confirm that they are numbers (and I assume the Id for the related SharePoint list object).
I copied the structure of the SharePoint list and pasted into a MS Access table, and then filled in a few sample records
I used the query wizard to select all of the fields of the Access table (minus the Access table's autonumbered ID and attachments), click "Append", and then selected the SharePoint list.
If I run this query, I get the error that X record(s) were not appended due to validation violation reasons, which is all of them. I've checked all field definitions and none are defined as required or have a validation constraint.
The only thing I can think of is that there is some issue with the Lookup fields, but each number Id I've checked is a valid Id.
I'm hoping for a MS Access solution, but if the only approach is to programmatically do it, could someone send me directions on how to get started with the SharePoint 3.0 SDK?
Thank you for your time.
Lookup columns are not number type even your parent items are of number type reason behind lookup column always attaches the item id of parent item.If you want to see the data in access kindly use the "export to Access" functionality available in datasheet view
I have linked to a SharePoint table, then appended directly to it from a query.
My issue is that this process takes a very long time to push up to SharePoint, then 2 times as long when first I need to delete the records currently in the list before appending.
Is there a better way to blow out and create the table while preserving the link since it is not an Access object?
Anyway I hope this may help you out some and get me some insight as well.
Regards.

Resources