How To Set A Parameter For Filtering Not Blank Records

Feb 7, 2007

In my report I want an optional parameter to filter all records with a specific field that is not blank. I tried several scenario's without result...

In the parameter I want to set a text value like "exampletext".

In the filter I want a check: if the parameter value is "exampletext", only show the records where field "abc" is not blank.

On the tab Filters from the Table properties I can set three values: Expression, Operator and Value.

Please help!

View 1 Replies


ADVERTISEMENT

Show All Records If SQL Parameter Is Blank?

Jan 1, 2008

 Hi:I have written a SQL statement that accepts a letter and then prints out all the records in a table starting with that letter.  I was wondering if there is a way that I could change the query so that if prints out all records if a blank or empty value is passed in?Here's my query: ALTER PROCEDURE [dbo].[GetMediaListByFirstLetter] (  @firstLetter char(1))AS    SELECT Media_ID, OrgName        FROM         Media         WHERE UPPER(SUBSTRING(Media.OrgName,1,1)) = @firstLetterAny help doing this would be greatly appreciated.Roger 

View 5 Replies View Related

Filtering Datetime Parameter

Sep 21, 2013

We can use LIKE '% ...%' for character string search but how can we do the same thing to a datatime parameter like '2013-09-20 13:34:43.098'?

View 12 Replies View Related

Filtering The Parameter Content

Apr 18, 2007



Hello,



I have built a report using a Cube (and not a relational database).



I have a date as a parameter and I would like to filter its content: the parameter goes from 1900 to 2090 and I would like the user to see only from 2006 to 2090.



Can you help me by giving me tricks to do it ? There may have several ways of doing it but I can't find them.



Thank you in advance !

Alexis







View 3 Replies View Related

Filtering Options In A Parameter

Aug 28, 2007



Hello, I have a report in which I would like to give the user the ability to select how a parameter is filetered.
Option 1 would be to filter by a range of value ie: WHERE member.age BETWEEN (@Start) AND (@End)
-say everyone between the ages of 50 through 80
Option 2 would be to filter by specific but multiple values ie: WHERE member.age IN (@Age)
-say anyone who is 25, 50 and 75.
How can this be done? Thanks

View 5 Replies View Related

Filtering Table Name With Parameter

Apr 2, 2006

<br><br>I obtain
table names from a database and pass them to a dropdownlist. Based on
user selection, I want to pass each table name to a query.Here is an
extract from my code:
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="select * from @dDTable">
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList1"
Name="dDTable" PropertyName="SelectedValue" DefaultValue="product"
Direction="InputOutput" Size="15" Type="String" />
</SelectParameters>
</asp:SqlDataSource>I keep getting this error: Must declare
the table variable "@dDTable".Please does anyone knows the best way to
go about this?

View 3 Replies View Related

Filtering Duplicate Records

Jul 3, 2001

hi,

I am trying to fetch data from 2 tables, say TABLE1 and TABLE2, both of which got columns like id and num. Then i want all the rows from TABLE1 where id1=id2 and num1 != num2.
but it is showing all the rows for an id1 twice, if there are two records in TABLE2 with same id and num.
is there any way to filter those records without using the distinct keyword.

regards
Rajeev.

View 1 Replies View Related

What Value Needs To Be Passed To Parameter In WHERE To Negate The Filtering

Apr 9, 2008

I am using two drop downs, like so:
<asp:DropDownList ID="ChurchStateDrop" runat="server"                              DataSourceID="ChurchStateDropData" DataTextField="State"                              DataValueField="State" AutoPostBack="True"                              onselectedindexchanged="ChurchStateDrop_SelectedIndexChanged"                             AppendDataBoundItems="True">        <asp:ListItem Value="?????" Selected="True" Text="All States" /></asp:DropDownList>
<asp:DropDownList ID="ChurchCityDrop" runat="server"                             DataSourceID="ChurchCityDropData" DataTextField="City"                              DataValueField="City" AutoPostBack="True"                             onselectedindexchanged="ChurchCityDrop_SelectedIndexChanged"                             AppendDataBoundItems="True">        <asp:ListItem Value="?????" Selected="True"  Text="All Cities" /></asp:DropDownList>
I have ????? in the value fields because I don't know what value needs to be passed to negate filtering (to choose all). The Dropdowns have the following SQLDatasources:<asp:SqlDataSource ID="ChurchStateDropData" runat="server"                               ConnectionString="<%$ ConnectionStrings:tceDatabaseOnlineSQLConnection %>"                                SelectCommand="SELECT DISTINCT                                                                        [State]                                                             FROM [ChurchView]"                               DataSourceMode="DataReader"></asp:SqlDataSource>
<asp:SqlDataSource ID="ChurchCityDropData" runat="server"                                ConnectionString="<%$ ConnectionStrings:tceDatabaseOnlineSQLConnection %>"                               SelectCommand="SELECT DISTINCT                                                                        [City]                                                             FROM [ChurchView]                                                          WHERE ([State] = @State)"                               DataSourceMode="DataReader">                               <SelectParameters>                                 <asp:ControlParameter ControlID="ChurchStateDrop"                                                                   Name="State" PropertyName="SelectedValue" Type="String" />                               </SelectParameters></asp:SqlDataSource>
Now, lets say I wanted to pass a value to the WHERE statement in ChurchCityDropData to coincide with 'All States', what would I replace value="??????" with? Now you may think I'm crazy to do such a thing, but this actually has to do with adding a Denomination Dropdown to show Denominations from all states or all cities. I will figure out the best logic for that later, I just want to know the wildcard to pass to the parameter to choose all states (negate filtering).

View 3 Replies View Related

Stored Procedure Parameter Filtering

Jan 24, 2008

consider a stored procedure with a parameter @OrderID, i want to perform the following query :select * from Orders where OrderID = @OrderIDi want the condition to be true when parameter @OrderId is null so what is the syntax for that? i think there is an IF CONDITION that can be embedded with where clause.

View 6 Replies View Related

Filtering Data Using A Boolean Parameter

Apr 24, 2008



Hello, I am trying to use a boolean parameter to filter data in a table, but there is something I am missing.

Basically I want something like this:
I have a boolean parameter, "EP", and I have a filter set on my table as:

Expression Operator Value
=Fields!REFERRAL_SOURCE.Value = IIF (Parameters!EP.Value, "1297", ????)

Using the filter tab, I can't specify an expression for the 'Operator' so I was trying to work it out using either '=' or 'like'. What needs to go into the ???? in order for the referral source to be "not 1297" (i.e. the inverse of the filter)?

Or, am I completely missing an easy way to do this?

Thanks.

View 4 Replies View Related

Filtering Records Through Join Or Where Clause

Apr 22, 2008

Hi All,
Can anybody tell me which of the following is the most efficient query if i have huge tables.


SELECT *FROM Tab1 Inner join Tab2 ON Tab1.Col1 = Tabl2.Col1 AND Tab1.Col1 = 5


OR



SELECT *FROM Tab1 Inner join Tab2 ON Tab1.Col1 = Tabl2.Col1WHERE Tab1.Col1 = 5

As long as i explored this, Sql Server Query Execution Plan shows the similar cost for both cases. Is there any difference?
If yes why?

Thanks in advance.

Regards,

Sulaman Riaz

View 4 Replies View Related

Allows Blank Value For Integer Parameter

Jul 3, 2007



Hi have a problem to solve and I hope that this is not a SSRS Bug.



I created a Reports(using SQL Server Project) which has several parameters which values are passed to a SP.



One of these parameter is an Integer and it is an optional value, so if the user fill it is used by the SP, otherwise the SP uses NULL and run anyway.



I starts to define tha parameter:

Datatype = integer

Allow blank value

Available: Non queried

Default: Null



if I want to Preview the report I have to provide an integer to the parameter's field ...



If for instance I set:

Default: Not queried = 0

In the moment I deploy and I use the ReportViewer in my window application the parameter's field is unabled!!



So I tried this solution:

Datatype = integer

Allow blank value

Allow null value

Available: Non queried

Default: Null



In the preview the checkbox: NULL is checked and I click on the View Report.

But when I deploy it,in the ReportViewer in my window application the parameter's field this checkbox is unchecked.



Do I forget something during my setting??I have to control it programmatically??



N.B. By default the user will not user this parameter so the best is that he can click directly on "View Report" without any additional "work" on the parameter!!



Thank you for any help!

View 1 Replies View Related

How To Ignor Filtering Criteria If There Is A Null Value For Parameter

May 15, 2008

I have gridview and i want to ignor that filtering if that parameter is empty how do i write that query.
my query is
select * from UserMAster where UserId=@USerID and RoleId=@RoleId
if @UserId is blank then i want to select all records without filtering with user Id a
nd if i have passed null or anything as parameter in roleId then alsoi want all the records if it contain value then i want to do filetring is it possible to with query. or else send me some alternative so that i don't need to execute more query.
 

View 7 Replies View Related

Filtering A Report On A DateTM Field Using A Parameter If Possible?

Apr 13, 2007

I am currently writing a report that will use as one of the filters the date (in this case it is the date of service of a physician office visit).

however the DB developers included the date and the time of the visit in one field so my resulting data set contains 4/13/2007 4:30pm for example, so using an @date parameter as a filter on the data field doesn't work because when you run the report and enter the date in the parameter it doesn't return anything.



I am an SQL Report writer amateur so I am sure there is an easy fix, any and all help will be appreciated.



Mark



View 7 Replies View Related

Filtering Parameters Based On A Selection Of Another Parameter

Dec 28, 2007



Hi,

Im trying to create a drop down parameter whereby if i select a certain field, a different dropdown will be filtered off only the relevant selections, is this possible.

View 7 Replies View Related

Filtering SqlDataSource To Show All Vs. Non-null Records

Aug 29, 2006

Hi -- I'm starting an ASP.NET 2.0 application which contains a page with a checkbox and gridview control on it.  In its default state the gridview displays all the records from a table pulled from a SQL Server database (via a SqlDataSource object).  When the user checks the checkbox, I want the gridview to display only the records where one of the columns is not null.  But I've been unable to construct the WHERE clause of the SQLDataSource object correctly.  I see that I can hard-code the SqlDataSource object so that the column to be filtered is always NULL or always NOT NULL. But I want this filtering to be more dynamic such that the decision to show all or non-null records happens at run-time.  Should I be using two SqlDataSource objects -- one for the NOT NULL condition and one for the "all records" condition?  Then when the user checks the checkbox, the gridview would be configured to point to the appropriate SqlDataSource object. (???)  Seems like a bit of overhead with that approach.  I'm hoping there's a more elegant way to get this done.  Please let me know if you need more information.  Thanks in advance. Bill

View 2 Replies View Related

Filtering Records In Datagrid Using Stored Procedures

Mar 11, 2008

I have created a stored procedure in sql server 2005 which will fetch a particular record based on the value we supply for a column. It is working fine. The same task i need to implement in my web form. I have a textbox in my webform where i will enter the empage which is in the table. Based on the value the record(s) should get displayed in the gridview. How to acheive this. Pls help me with full coding. it is urgent.
Thanx is advance

View 1 Replies View Related

Set Input Parameter To Zero If Null Or Blank

Jan 8, 2015

I am passing few parameters to the sql function to do some calculations. If the input parameter is null or blank, then I want to set the input parameter to the value zero

View 1 Replies View Related

Is There A Way To Default DateTime Parameter To Blank?

Jul 13, 2007

I have a visible DateTime parameter on the Report that I would like to make optional.

When I open up the report and try to run it without specifying the date I get a validation error that parameter is required. If I set default value to null - it works, but I have to check for both '' and NULL in my query:

StartDateTime >= @StartDate OR @StartDate='' OR @StartDate IS NULL

I tried setting default parameter using expression
=''
but I get an error that
'Default Value' of parameter 'StartDate' doesn't have expected time.

So the question is can I set DateTime parameters' default value to blank?

View 7 Replies View Related

Allow Blank Value Does Not Effect When Parameter Is Multi Value = Bug!

Jan 3, 2008

I build reports using reporting services 2005 sp2.
I have 3 parameters---> 3 multi value combo box .
However when I tick "allow blank value" within the report parameter
properties for this drop menu, report WILL NOT run without making
selection.(The xml is ok allow blank value set to true)
the reports still require you to enter a value for all parameters in the report when the report can and should be able to be run with no parameter defined.
the trick "default values for all of the params to "=String.Empty"" is not good .


I found this article but i can't find microsoft hotfix for it .

http://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=125877


"Thank you for filing the bug. This issue has been fixed for the next CTP.
Posted by Microsoft on 8/11/2005 at 7:00 PM"

Am I missing something obvious here?

View 1 Replies View Related

Selecting &&<BLANK&&> As Default Value Of The Parameter

Aug 21, 2007

Looks like a very simple problem but not geeting it..
I have parameter as ALL and it has corresponding value as <BLANK>,which comes by default.
Allow Blank to true

How I can select this parameter as default value in parameter??

Please make sure that if I am taking '' then it is getting treated differently.I don;t want Value of ALL as '' or NULL

Niether I have permission to change sp

I want <BLANK> value to be selected internally

Any help will be appriciated.

-Thanks,
Digs


View 1 Replies View Related

How To Remove Blank Spaces In Records??

Jun 23, 2005

We imported approximately 2.9 million records from our mainframe server
into our SQL Server but have run into a problem.  The data in a
few of the fields contains both leading and trailing spaces.  An
example of the data would be like this, using periods to represent
spaces:

What we have:

..1A02938.....

What we need:

1A02938  (no spaces)

 Is there some sort of algorithm I can run on the data to remove
those spaces?  The problem is coming up when trying to perform a
SELECT query.  We try something like:

SELECT * FROM PCPIPT0 WHERE PANO20 = "1A02938"  but we get zero
results because of the spaces in the database.  The datatype of
the filed is char(20) because we need some flexibility on the size of
the data stored.

Any assistance would be greatly appreciated.

View 5 Replies View Related

Find Records With A Blank Field

Mar 13, 2000

I want to be able to use a query to display all the records in the 6.5 database that have no data in the STATUS field. This is the query I thought would work....."SELECT * from travel_date WHERE status="''"

But, that is not working. Can someone please help me figure out the right way to wrtie this?

I appreciate your help!

View 2 Replies View Related

Replacing Blank Records With Text

Mar 20, 2006

Hi there,

I'm in a bit of a jam here and will appreciate any help.

I need the SQL code to replace a record if the record is empty.

For instance, I have about 7 columns containing over 40K records. In the firstname field, some records are blank. I need to replace all the blank firstname fields with this: 'now invalid' (without the quotes)

What would be the best way to achieve this?

Thanks

newbie:o

View 6 Replies View Related

SQL / Not Existing Records As Blank Cells

Oct 7, 2007

hi

I have data in two tables.

NAMES
IDName
1FIRST
2SECOND


CODES
IDCodeTypeCode
1Axyz
1Babc
1Cgfd
2Axdz
2Bdca



I want to join the two tables to add the Code of CodeType "C" to the records of NAMES

Result Example
IDNameCode
1FIRSTgfd
2SECOND----


I want to have all records from the names with the codetype C, if there is no record with the codetype c for a given ID, the cell should be blank to identify for which ID's the CodeType C is mising.

how should the sql statement look like?

Please help!
thanks in advance!

Mikk

View 1 Replies View Related

Filtering Data Based On Select Parameter Values

Jun 6, 2006

Hi,

I am using SQL 2005. I have a SELECT query in a stored proc with 3 parameters:
@subaccount,@numDaysCutoff,@numDaysPcts. The proc needs to be modified to return data when subaccount values are any of these:

FRRIJ
FRRIC
FRMM
ROBECO
FRJV
MAIL
FRUKV
FRICE

Currently I use a WHERE condition and am able to get data correctly. However, for a NULL value I should get everything including those not in the above list. Should I use CASE statement instead? How?

@subaccount VARCHAR(8) = NULL
, @numDaysCutoff INT = 1
, @numDaysPcts INT = 1

SELECT Subaccount = ISNULL(h.subaccount, lo.subaccount)
, SecurityID = ISNULL(h.security_id, lo.security_id)
, SecurityName = s.name
, QtyHeldAndPending = ISNULL(h.quantity, 0) +
(CASE WHEN lo.type = 1 THEN lo.resulting_quantity * (-1)
WHEN lo.type = 2 THEN lo.resulting_quantity
ELSE 0 END )
, L.AverageDailyVolume
, XDaysVol = L.AverageDailyVolume * @numDaysPcts
, CutoffVol = L.AverageDailyVolume * @numDaysCutoff
, DaysVolHeld = h.quantity / NULLIF(L.AverageDailyVolume, 0)
, HeldPctNDaysVol = h.quantity / NULLIF((L.AverageDailyVolume * @numDaysPcts), 0) * 100
, TargetedHoldingsUSD = tm.ApprovedPortfolioTarget * iv.value_usd
, CutoffVolUSD = L.AverageDailyVolume * @numDaysCutoff * s.price_usd
, TargetedPctNDaysVol = (tm.ApprovedPortfolioTarget * iv.value_usd) /
NULLIF((L.AverageDailyVolume * @numDaysPcts * s.price_usd), 0) * 100
, DaysVolTargeted = (tm.ApprovedPortfolioTarget * iv.value_usd) /
NULLIF((L.AverageDailyVolume * s.price_usd), 0)
, NDaysCutoff = @numDaysCutoff
, NDaysPcts = @numDaysPcts
FROM subaccount_positions_table h --vGlobalHoldings h
JOIN iv_subaccount_table iv ON iv.subaccount = h.subaccount
FULL OUTER JOIN LiveOrders lo ON lo.subaccount = h.subaccount AND lo.security_id = h.security_id
FULL OUTER JOIN TM_DerivedSecurityTargetDetail tm ON tm.Subaccount = h.subaccount AND tm.SecurityID = h.security_id
LEFT JOIN dbo.security_table s ON s.security_id = COALESCE(h.security_id, lo.security_id)
LEFT JOIN dbo.SecurityLiquidity L ON L.SecurityID = h.security_id AND SourceID = 99
WHERE (h.subaccount = ISNULL(@subaccount, h.subaccount)
OR lo.subaccount = ISNULL(@subaccount, h.subaccount) )
AND status = 1
AND ( h.quantity > (L.AverageDailyVolume * @numDaysCutoff) -- qtyHeld > XDaysVol
OR -- Targeted Vol exceeds cutoff
ISNULL((tm.ApprovedPortfolioTarget * iv.value_usd), 0) >
ISNULL((L.AverageDailyVolume * @numDaysCutoff * s.price_usd), 0) -- Target > XDaysVol
)
ORDER BY ISNULL(h.subaccount, lo.subaccount), ISNULL(h.security_id, lo.security_id)

Thanks in advance!!!
sqlnovice123

View 2 Replies View Related

Value Of Stored Procedure Output Parameter Is Blank

Mar 31, 2004

Here's my stored procedure...


CREATE PROCEDURE [Get_WirelessProducts_By_Page]
@CurrentPage int,
@PageSize int,
@TotalRecords int output
AS
--Create a temp table to hold the current page of data
--Add and ID column to count the records
CREATE TABLE #TempTable
(
ID int IDENTITY PRIMARY KEY,
ProductID int,
ProductCategoryID nvarchar(50),
ProductBandwidthKB int,
ProductOverridePrice nvarchar(50),
UseWirelessOverridePrice bit,
DedicationTypeID int,
DedicationTypeName nvarchar(50)
)
--Fill the temp table with the Customers data
INSERT INTO #TempTable
(
ProductID,
ProductCategoryID,
ProductBandwidthKB,
ProductOverridePrice,
UseWirelessOverridePrice,
DedicationTypeID,
DedicationTypeName
)
SELECT
W.ProductID,
W.ProductCategoryID,
W.ProductBandwidthKB,
W.ProductOverridePrice,
W.UseWirelessOverridePrice,
W.DedicationTypeID,
D.DedicationTypeName
FROM
tblWirelessProducts W
INNER JOIN tblDedicationTypes D ON W.DedicationTypeID = D.DedicationTypeID
--Create variable to identify the first and last record that should be selected
DECLARE @FirstRec int, @LastRec int
SELECT @FirstRec = (@CurrentPage - 1) * @PageSize
SELECT @LastRec = (@CurrentPage * @PageSize + 1)
--Select one page of data based on the record numbers above
SELECT
ProductID,
ProductCategoryID,
ProductBandwidthKB,
ProductOverridePrice,
UseWirelessOverridePrice,
DedicationTypeID
DedicationTypeName
FROM
#TempTable
WHERE
ID > @FirstRec
AND
ID < @LastRec
--Return the total number of records available as an output parameter

SELECT @TotalRecords = COUNT(*) FROM tblWirelessProducts
GO
Here is the relevant VB Code:
Dim parmReturnValue As SqlParameter
'conProducts is already open
cmdProducts = New SqlCommand("Get_WirelessProducts_By_Page", conProducts)
cmdProducts.CommandType = CommandType.StoredProcedure
cmdProducts.Parameters.Add("@CurrentPage", intCurrentPage)
cmdProducts.Parameters.Add("@PageSize", dgrdProducts.PageSize)
parmReturnValue = cmdProducts.Parameters.Add("@TotalRecords", SqlDbType.int)
parmReturnValue.Direction = ParameterDirection.Output
conProducts.Open
dgrdProducts.DataSource = cmdProducts.ExecuteReader()

If Not IsDBNull(cmdProducts.Parameters("@TotalRecords").Value) then
Response.Write(cmdProducts.Parameters("@TotalRecords").Value)
End IfThe rows are returned correctly, but the output parameter "@TotalRecords" doesn't return anything. Any ideas what I'm doing wrong? Thanks in advance for your help.

View 1 Replies View Related

Reporting Services :: How To Pass A Blank Parameter

Nov 24, 2015

I have 5 Parameters created in my report.

1, 2 and 3 parameter are text inputs. 4th is multi-value parameter and 5th is again a text input. I need to Pass a blank parameter to my 5th parameter.

1) I tried the below Expression in the "UploadedEnt" DataSet Properties and not in the "Main" DataSet.

=IIF(Parameters!UploadedEntiParam.Value ="",Nothing,Parameters!UploadedEntParam.Value)

I have taken the actual sql query (file) and I have just placed the select statement.

DataSet Name: UploadedEntselect distinct UploadEnt
from
(
SELECT DISTINCT col1, col2...
....) Ent

Order by 1OR logic has been applied in the Tablix Properties Filters as an expression.=Fields!value1.Value like Parameters!value1Param.Value Or Fields!value2.Value like Parameters!value2Param.Value Or Fields!value3.Value like Parameters!value3Param.Value Or Fields!value4.Value = Parameters!value4Param.Value(0) Or Fields!UploadEnt.Value = Parameters!UploadedEntParam.ValueFilter: Expression = TRUE2) I tried applying NULL check box which works perfectly but I do not want to apply that here.How to Pass a Blank Parameter?

View 2 Replies View Related

Enable Parameter Of Type Date To Be Blank.

Feb 11, 2008

Is it possible to enable parameter of type date to be blank (not null)?

I created parameter of type date, gave it no default value, when I pressed the preview tab I got error message "The property 'DefaultValue' of report parameter 'DateParamName' doesn't have the expected type"
Thanks in advance!

View 21 Replies View Related

Reporting Services :: How To Get A Blank Parameter To Work

Jun 3, 2015

Have a report that has this as the query:

SELECT SOURCE, TRANSDATE, LOCATION, DESCRIPTION, MOACTIVETIMESTAMP, MOINACTIVETIMESTAMP
FROM CTS_Missing_Data_Report_VW
WHERE LOCATION = @Location AND SOURCE = @Source AND (TRANSDATE BETWEEN @StartDate AND @EndDate)
ORDER BY Transdate desc, Location

So the user can enter a value for Location and Source and select the date range.BUT I also want the user to be able to put in nothing for the Location and Source so the query would return everything for that date range.

So if they did this the query would be

SELECT SOURCE, TRANSDATE, LOCATION, DESCRIPTION, MOACTIVETIMESTAMP, MOINACTIVETIMESTAMP
FROM CTS_Missing_Data_Report_VW
WHERE (TRANSDATE BETWEEN @StartDate AND @EndDate)
ORDER BY Transdate desc, Location

I have set the parameters @Location and @Source to "Allow blank value" in the datasets for the location and source I have :

SELECT NULL AS Source
UNION
SELECT DISTINCT RTRIM(LTRIM(SOURCE))AS Source
FROM CTS_OPS_SOURCE_LOCATION_TBL_VW
ORDER BY SOURCE

So a blank will show on the drop down and when I run the query for the Query Designer in the Dataset Properties the results does show  a blank record for the first record.BUT when I Run the report there are no blanks in the drop downs for the location or source. And there is no '<blank>' selection in the drop down either. And the drop down insist the user selects a value from both of the drop downs.

What am I doing wrong?

View 5 Replies View Related

T-SQL (SS2K8) :: Displaying Sum Of Records And Show Row Even If It Is Blank Or Zero

Mar 10, 2015

I am creating a report on an asp.net webpage to show how many times a coupon has been used from a set list of items.There are two tables I am using for this query.Table 1 has the list of items or coupons. Table 2 has a column for the item id from Table 1 and a value.

Example:
Table 1
id Name
1 Coupon1
2 Coupon2
3 Coupon3

[code]...

My current query will only show coupon1 and coupon2 and the number and value. It will not show coupon2 since it hasn't been used. I would still like to show coupon2 with a number of zero and a value of zero.

Current query is:
SELECT Table1.Name, COUNT(Table2.ID) AS CNum, SUM(Table2.Value) AS CValue FROM Table2 JOIN Table1 ON Table2.ID = Table1.ID GROUP BY Table1.Name

View 5 Replies View Related

Reporting Services :: Hide Blank Row With Multi-value Parameter

Jul 20, 2015

I have a Multivalue parameter with 4 available values and have 4 columns in the report that correspond to each of these values.I apply column visibility to each of the 4 columns with the following expression (the number changes for each column

=IIF(InStr("," & Join(Parameters!KPINAME.Value,",")& ",",",1,")>0),False,True)

What I want to do is that if I select a KPI and the Column value is NULL then to hide the row.Obviously if you select multiple KPIs and only 1 of the columns has null value then I wouldn't want the Row hidden.

View 5 Replies View Related

Gridview - SqlDatasource - How Do You Get All Values For A Like Text Parameter Or A Boolean Field When Filtering?

Mar 18, 2008

I have a gridview connected to a sqldatasource, and it works pretty good.  It gives me the subsets of the information that I need.  But, I really want to let them choose all the companies and/or any status.  What's the best way to get all the values in the gridview...besides removing the filters :)
I thought the company would be easy, I'd just set the selected value to blank "", and then it'd get them all....but that's not working.  And, for the boolean, I have no idea to get the value without having a separate query.
(tabs_done=@tabsdone) and (company like '%' + @company + '%')1 <asp:DropDownList ID="drpdwnProcessingStatus" runat="server">
2 <asp:ListItem Value="0">Open</asp:ListItem>
3 <asp:ListItem Value="1">Completed</asp:ListItem>
4 </asp:DropDownList>
5
6
7 <asp:DropDownList ID="drpdwnCompany" runat="server">
8 <asp:ListItem Value="">All</asp:ListItem>
9 <asp:ListItem Value="cur">Cur District</asp:ListItem>
10 <asp:ListItem Value="jho">Jho District</asp:ListItem>
11 <asp:ListItem Value="sea">Sea District</asp:ListItem>
12 <asp:ListItem Value="san">Net District</asp:ListItem>
13 <asp:ListItem Value="sr">Research District</asp:ListItem>
14 </asp:DropDownList>
15
16
17 <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:HRFormsConnectionString %>"
18 SelectCommand="SELECT DISTINCT [id], [lastname], [company] FROM [hr_term] hr where (tabs_done=@tabsdone) and (company like '%' + @company + '%')">
19 <SelectParameters>
20 <asp:ControlParameter ControlID="drpdwnProcessingStatus" DefaultValue="0" Name="tabsdone" PropertyName="SelectedValue" />
21 <asp:ControlParameter ControlID="drpdwnCompany" DefaultValue="" Name="company" PropertyName="SelectedValue" />
22 </SelectParameters>
23 </asp:SqlDataSource>
24

 

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved