Report from SQL to Excel using user prompts - sql-server

I am pulling a report from SQL in Excel. I got it all working, except I need multiple user prompts (one parameter with multiple values).
I decided to use a listbox which contains all the possible selection that I want the user to choose from (These values are on another sheet in the same workbook) and then when a button is clicked, it displays the information in that same worksheet base on the selected choices the user choose.
This information that is being displayed is coming straight from SQL server.
I tried using a userform in VBA in Excel, but I am still not quite sure how to have it pull from SQL base on the selections in the listbox.
I had it where the information was displayed, except I was only able to input one parameter at a time. I want the user to be able to do multiple selections and then the information is displayed.
In my query I had wmav_code = ? to prompt the user to input what code they wanted, but as stated before, it generates a report base on that one value. I tried wmav_code in (?,?,?,?), however, that's limiting the prompts to 4. I have 97 various codes to choose from (Hence the decision to use a listbox).
I tried (InStr(?, [wmav_code])>0), but Excel 2016 does not recognize that function (InStr()).
P.S. These are all within the 'WHERE' clause.
I don't have to use a listbox, a simpler route/method would be appreciated.

Related

MsAccess - Combobox inputs ID into table instead of the text I want it too

I'm using a combobox in a Ms Access form that gets it options from a separate table. I want it to be used by end users to input data into a table. Said data needs to be without errors because a 3rd party program (Qlik) will read the table contents and create a report on our workers and their "statistics".
I figured I want a dropdown menu, but when I use the combobox it input the ID of the text instead of the text itself.
Is there a way to have a dropdown menu in a Ms Access form that will input text into my table.
PS: I don't know if it's relevant but Ms Access is only being used as a front end for end-users. the data all ends up in a MySQL database.
I've looked at all the options I could find and I've been googling for a while but I can't seem to find a solution.

How do I query my database in Windows Forms?

I'm creating a small C# app in VS2015. I need a way for the user to enter a value in a text box, then retrieve the results from the database. I've already defined the dataset and made the appropriate relations. There are 9 tables in the dataset. (This generated a whole boat load of code.)
The query will use all 9 tables (I've check the syntax, the query is correct) and return 1 row with 23 columns. I put a text box and button on the form, the idea is that the buttonClick will execute the query based on what was entered in the text box. I'd also like to display the results in a list-type fashion. I don't have any idea what to do next.
TIA,
Tracy

SSRS Report-outputting ''Blank'' rather than 0 for end user

First off, I am new and just learning about databases and reporting functionality.
Background: Let's say that I am an end user and I have requested a report from my IT department. I know that my company uses SQL server and they generate SSRS reports frequently.The SQL Server database is connected to a PIM(product data) application. Within the PIM there is a numeric field holding a quantity of bulbs. In the event that there is no bulb, that field is left blank. I do not have access to our database or the reporting parameters. I am at the mercy of someone else essentially.
When I receive my report, I see zeros '0' for every item that doesn't have a bulb. That is not the desired output, I want to see the field as a 'blank' just as it is in our PIM system. When I expressed this to the report writer, he informed me that this could not be done because that is a numeric field.
Does this seem correct? Please help!! I am fighting an uphill battle. I have a job to do and it relies heavily on IT support. I now have to go to my boss and tell her that this can't be done. I also understand that I can manually manipulate the report myself in excel but this is time consuming and if this can be handled before the report hits my inbox, that would be ideal. If there is a solution that someone out there can relay to me, I would be so appreciative-Thanks!!
If the report is definitely generated in SSRS, it is absolutely possible to set zero values as a blank field. To me, it sounds as if the person responsible just doesn't want to make the change because it's a fairly simple fix. It's as simple as opening the properties window of whatever field needs to be fixed. Since the field is numeric, you would want to format the textbox as a number anyways. The highlighted option displays where this change can be made. There's actually three default options for Show zero as: being blank, a dash(-), or displaying (None).

How to create a button that extracts data from a query in Access 2010?

I work for a private healthcare organisation which provides healthcare to other organisations. I have an Access database that will allow a user to view all the healthcare we have provided to a specific client. For example, Company A - we have provided their staff with a vaccine etc.
What I need to know is how do I create a button on a form which will allow me to extract data from one of my queries?
In this case, I want the button 'Extract Data' to retrieve information from my 'Customer_Name' query (unable to post picture as I don't have enough reputation).
I've tried using the Wizard that opens when you create a button, but I guess i'm not selecting the right option.
The first thing you need to do is create the query which will provide the exact extract that you need. Since you haven't given much information in that regard, I will assume you have created this query already.
The next thing you need to do is determine whether you want to display this on a form or in a report. If it's on a form, you need to decide whether you want to make it a "Continuous Form" or not. A "Continuous Form" allows you to see multiple records simultaneously, while a standard form does not. Add the query you've created above as your form or report's RecordSource.
Once you have created your form or report, all you need to do is create a button to open the form or report. For this, you would add a new button using the wizard, choose either "Form Operations" or "Report Operations" and the appropriate "Open" option under that. Then you select the form or report you want to display.

Gather inserted text values from multiple rows in a report

I'm currently struggling with Oracle Apex.
I'm trying to create an application which enables customers to place their order. Therefore I create a report which lists the available products. Furthermore the report contains a column (the SQL query for that is simply '0' as "Quantity") which displays a text box. In this text boy the customer should be able to insert the required quantity.
I've create a screenshot to make it easier to follow me:
After the customer has fill out the form, the "Place Order" button will purchase the wished items then.
My question is now, how is it possible to read out in which text boxes did the user filled in a number and also to which product belongs it!
An easier solution would be to recreate the region but choose Form Region and then Tabular Form Region and then the wizard will help take care of the DML for you. But you need to use specific table columns for this to work.
To answer your question more directly - the input items defined in reports that are posted to the server can be accessed in PL/SQL as a set of "Global Arrays". These are defined as PL/SQL tables in the package apex_application with the names g_f01 through g_f50.
To be sure which of these arrays to use for the quantity text box you can look at the html of the page for the name attribute of the input tag. If it is f01 then you would be able to process the results by accessing each position or element in apex_application.g_f01.
To link the input with the table you would need some sort of key. If you use the wizard to build a Tabular Form all this headache is taken care of for you though.

Resources