I have a Summary report and a Detail (drillthrough) report.
the summary report displays.
Summary report
Code Snippet
Adult | Male | Count
-----------------------------
Yes | Yes | 50
Yes | No | 9
No | Yes | 20
No | No | 50
------------------------------
| 129
When the user clicks on the hightlighted count it links to the Details report displaying each of the records referenced.
The detail report uses 2 boolean parameters Adult & Male, this works perfectly for the first 4 lines displayed, however if the user clicks on the total value to display all the records, i'm unable to provide the NULL value.
I'm having a problem showing my boolean default parameter on report server in our test environment.
The report server shows my boolean parameter with a yes and no radio button. I assigned my boolean parameter with a 'No' default. The default shows and runs fine when I run the report within Visual Studio.(I hope I'm using the correct terminology.) However, on the report server the 'No' radio button is not checked by default. What am I doing wrong?
hello at everybody well i have a problem. with in a package i defined a bollean variable with the name "x" and with a default value FALSE.
i created a configuaration file that contains the variable "x" as [user::x]. when i deploy the package to a server and i try to execute the package putting to the set values TRUE fror the x variable it doesnt work.
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?
I have got a stored procedure with a parameter on a boolean field. When the parameter is passed down I must retrieve records according to the boolean value. That is if it is true retrieving records with the true in that field, if it is false retrieving records with false. And if no parameters is passed down just retrieve all records either with true or false. I have done something similar with integer fields and it works but in that case I wasn't able to make it working.
See at the following sample I am expecting when executing the 3rd time my below to return 4 and it returns 0
CREATE TABLE #temp ( Id int, Name char(30), YesNo bit ) INSERT INTO #temp (Id, Name,YesNo) Select 1, 'a', 0 INSERT INTO #temp (Id, Name,YesNo)
I'm trying to create a WHERE clause that will have different results depending on a parameter that is entered. For example, if you put in a number, it will only calculate the rows where the column ID matches that number. However, if you put in 0, which doesn't exist in that column ID, it will instead calculate all the data in the table.
So the below would be a very basic idea of what I'm trying to do, but I'm not sure how to do it with proper syntax.
SELECT dbo.incident.incident_ref, Customer.cust_n,incident.date_logged FROM incident INNER JOIN Customer ON incident.incident_id = Customer.cust_id WHERE incident.date_logged BETWEEN @date_from AND DATEADD(day, 1, @date_to)
I need to use a condition here to display customer based on my selection in dropdown list (Include ABC )
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
I have a stored procedure that returns 1 or 0 as one of the column value. When i execute this stored proc and fill the Data Table in .Net, the data type of this column in Data Table is becomes integer not boolean. What should i return from stored procedure so that when i fill data table the column's datatype will be boolean NOT integer? or is there any way to change the DataType of the column in Data Table?
I have a control with checkboxes. The checkbox.checked property returns a boolean value. If I want to insert a record into a table that has a corresponding column of type bit, how do I do it?
I triedCType(myChkBox.checked,String), which returns the strings "True" or "False". But, I get the errorThe name 'True' is not permitted in this context. Only constants, expressions, or variables allowed here. Column names are not permitted.I then tried "CAST(" & CType(myChkBox.checked,String) & ",bit)", but got the same error.
I can write a function that will return a 1 or a 0 but that seems ludicrous. Surely there must be a more elegant way to use the result of a checkbox in an SQL statement.
Hello,In VB/VB.NET, I can use an expression as such to evaluate true/false:Dim blnValue As Boolean = (SomeObject.Property = "Some value")Can I do this in T-SQL?declare @var bitset @var = ?Thanks.
Hi, I have a FormView with a couple of TextBoxes, a DropDownList and two CheckBoxes. I have connected a SQLDataSource to the FormView with an InsertCommand to store the values entered into the different conrtrols. My problem is that the boolean values from the two CheckBoxes doesn't get stored in the Database (SQL Server Express). The columns in the DB are of type "bit", should I choose a different type? I don't see any errors just a NULL value in the DB. I'm probably missing the obvious taken that I'm really fresh to this, so any help would be appreciated...
Im wondering how to do a boolean equivilent while creating tables. here is an example: ProgramNoNUMBER(10)NOT NULL,
Instead of Number(10) how would I make that a boolean in sql? Im sorry if this is a really easy question, but I looked around online and either was looking for the wrong thing or couldnt find it.
Well i guess thats not entirely true, I found it on wikipedia, but just swapping in BOOLEAN doesnt work. Can anyone tell me the syntax? Thanks
Hi,I am trying to get a 0 or 1 depending on the sucess or failure of at-sql statement, and here is what I have:Declare @boolDatabaseExists bitDeclare @chvnNewDatabaseName nvarchar(260)SET @chvnNewDatabaseName = 'NewDatabase'SET@boolDatabaseExists =(SELECT(1)FROMmaster.dbo.sysdatabasesWHEREname = @chvnNewDatabaseName)Print @boolDatabaseExistsWhat it is doing right now is that it prints a 1 for when there is amatch for the @NewDatabaseName in the sysdatabases table. If there isnot a match, then there is no value set for @ boolDatabaseExistsWhat I would like it to do is if there is no match for the@NewDatabaseName in the sysdatabases, I would like to set theboolDatabaseExists to 0I hope I am clear in my explanation.Thank youKR
I have a unusual problem, well it is unusual becaue i cannot understand it.
I am retrieving the following data, Revenue, Sales, Commission, and calculating Commission Rate in the report itself.
I got warnings that a textbox that was attempting to calculate the Commission Rate was trying to divide by zero.
When I analysed the data, I realised that indeed there were instances when Revenue was 0.00 and therefore when calculating the commission rate, commission/revenue it returned an error.
I then thought I'd do the following in the expression field
it does work. In fact if I use any other identifier or use two field thats add, subtract or multiplied with each other it will work. The problem only arises is when I decide to divide two fields together.
Strangely if the condition is satisfied - [Fields!RevenueGbp.Value = 0.00] - it will still try to work out the division even though it should just return Zero!
I want to have an update statement like:update tblMydate set fieldx=fieldx+1 where code=12But then for a boolean value:So, if the current boolean value is true, I want to set it to false and vice versa, something likeupdate tblMydate set booleanx=not booleanx where code=12How can I achieve this?
Hi... I have a problem getting a select statement to return a boolean value from sql server... the aim is to populate a checkbox list with permissions a group of users has. The statement is an outer join as follows: select SS.PermissionName, BB.GroupId,case when BB.GroupId Is Null then cast(0 as bit) else cast(1 as bit)end IsAddedfrom clPermissions SS left join ( select PermissionName, GroupId from clvGroupPermissions where GroupId = (Select groupId from clGroups where GroupName = 'Admin')) BB on SS.PermissionName = BB.PermissionName The returned values are 0 and 1... but .NET does not seem to recognize these values as true and false...Any one had an issue like this before?
Obviously, I'm new to SQL Server, because I'm still scratching my head wondering where in the world the boolean data type is. Can anyone please explain to me how boolean data types REALLY work in SQL Server? I've created a few Bit type fields, but when using a datagrid, they sometimes show up as 0 and 1 and sometimes as True/False, and I can't see a difference in how the grids (or fields(!)) are set up that would explain this. Any insight would be greatly appreciated!
Hello, In an update statement, I want to take a boolean and reverse it. Is there an easy way to do this? SOmething like: update table set boolfield = not boolfield where ID = @ID but that doesn't work; is there anything like this where it will reverse it easily? Thanks.
Hi, I am looking for an easy and efficiant way to add a boolean search function to an already existing search i have using ASP pages and MSSQL 2000 SPROCS.
Currently I have some code such as:
CREATE PROCEDURE sp_name
@var1 int = NULL, @var2 varchar(50) = NULL
AS
SELECT blah, blah, blah FROM sometable INNER JOIN anothertable ON anID = anID WHERE (table1.column2 = COALESCE(@var1,table1.column2) AND table2.column4 = COALESCE(@var2,table2.column4))
and this works like a charm, if i pass a value into @var1 or @var 2 it gives back results where those crietera match, or if I pass no values in it returns all records.... anyways, you get the idea...
Now I would like to add the ability to introduce a 3rd variable, and have it run a boolean search on a varchar(2500) column. This column is a description field for an image so I would like to be able to search the descriptions by passing in something like 'car OR bike AND travel' and return all the records that have the words 'car' or 'bike' and 'travel' somewhere in the description field.
How can i do this? I am using SQL Server Standard Edition so I don't believe I have full text search functions available, (not sure if that would even help).
Thanks all for your support and guidance!
P.S. i would also like to maintain the functinality so that if all the @var# are blank it still returns all records.
What data type should I use as a replacement of Boolean in SQL server? I need to create a table column with a "two-state" data type and must ensure, that only one record can hold value "True" in this column... Any ideas? Thanks
I know this is a stupid question, but I've searched and can't seem to find it.
What do you use in SQL when creating a table and the field is a "yes/no" type field? In VB isn't that a boolean data type? What is the corresponding SQL data type?
Brand new to the forum and I'm hoping I can get some help from you guys here.
I'm not sure how I would go abouts doing this but I have a table that has a list of my Inventory and it looks like this.
Product Inventory Modems 10
I want a way (whether it be a stored procedure or view) to display instead of the value of 10, that if there Inventory has a value greater than 0 then to return a boolean of YES, TRUE, or 1. How would I go abouts doing that?
I'm new to databases. So I'm writing code in c# to search a database. Here is the following SQL statement I'm trying to use: SELECT Movies.Movie, Movies.Genre, Movies.ReleasedFROM Movies INNER JOIN MovieActor ON Movies.Movie = MovieActor.MovieWHERE (MovieActor.Movie = '% ' & @name & ' %')
When I go to test the statement it says that "Data types varchar and varchar are incompatible in the boolean AND operator." Any ideas around this?
I have created a matrix where I have booleans on the rows and columns. They are initially in the collapsed state. For reporting purposes, I would like the initial state to to be expanded or at list a quick fix to quickly convert the collapsed booleans to expanded booleans.
I have navigated to the Layout tab and right-clicked the fields that are tied to the boolean and then clicked on the properties. This bring sup the Textbox Properties. From here, I click on the Visibility tab. At the bottom of the textbox is a section "Initial appearance of the toggle image for this report item:". The default choice is marked as collapsed (+). One would logically think that you you would have to do then is select the expanded (-). choice. Well, when I do this, all it simply does is chance the icon from a '+' to a '-' and the fields are still shown as collapsed.
Hi, I have created a report parameter using a Boolean data type.
When I preview my Report I can select either True or False for this parameter. Is there any way of changing the 'True' label to say something else and again the same with the 'False' label?