.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Post New Web Links

filter n compare between two table in resultset

Posted By:      Posted Date: August 23, 2010    Points: 0   Category :ASP.Net
 

Hi .. I have two table 

Say Table1 n Table2

Table1

Item              ItemName

001                 Laptop

001                  PC

002                  PC

002                  Printer

003                  Pendrive

004                  Keyboard

004                  CPU


Table2

Item                  ItemName

001                   laptop

001                   PC

002                   Printer

004                   CPU


Here am comparing table1 with table2

The Itemname which is available in both table1 n table2 should be dropout ... Other Item should be displayed ...

I need the sql result set like this :

Item                 &n


View Complete Post


More Related Resource Links

Using jQuery to Filter Table Rows

  
The project is using the .net GridView control, so I had limited control over the output HTML code. Still, I think this code can work for most tables. One thing to notice: you should use the class "filterable" on your table or on one of its parents for the code to work.
First, we need a text box:

Join Filter for n to n Table

  
Hi all, We have a merge publication system in SQL 2008 R2. Publication is Enterprise Edition, Client's are Express Edition. Basically, we have 3 tables Roles, UserRoles,Users. Role : RoleID, RoleName columns User : UserID, UserName columns UserRole : UserID,RoleID columns   I want to filter these tables by HOST_NAME() function, which is equal to UserID for each subscription. IF i set Dynamic Filtering for User table (UserID=HOSTNAME()) , i receive only 1 row in User table in subscription database, ok. And also i set same Filter to UserRole table, and i can get only needed RoleID's to UserRole table, ok. But when i want to receive only necessary Roles to subscription database Role table, it does not work. I tried to use a Subquery, but i understood that it is a static filtering method. I tried Join filter for Role table, but i always receive all roles to Role table. I tried "SELECT <published_columns> FROM [dbo].[Role] INNER JOIN [dbo].[UserRole] ON [Role].[RoleID] = [UserRole].[RoleID]". But it receives all roles to Role table. I tried several Join filters for these tables but can't find a solution. How can i handle this?   Best regards.      

Excel pivot table report filter selections from a cube

  
There are two filters added to the report filter, Date (8/31/2010) and Product (Product A), from a cube I have.  Everything works just fine.  Once the cube is refreshed each day to include the new data, for some reason, only the selection of Date, 8/31/2010, stays but the selection of Product changes to All Products.  Both dimensions are fully processed but the surrogate keys for existing records do not change.  I checked the MDX captured in Profiler and in the where clause, the date selection is passed from the pivot table but the product selection is lost and all products is passed in.  Any thoughts? TIA. 

group on or filter multiple datasets in 1 table?

  
I am fairly new to using BIDS, so please bear with me. I currently have 2 datasets, and 1 table.  The layout of the table is: Header HeaderGroup1 HeaderGroup2 Details FooterGroup2 FooterGroup2 Footer Group1 Footer Group1 Footer This is working, but what I need to do is figure out a way to add another Footer Group2 that includes an expression which involves either using data from a 3rd data set because of needing a different filter, or figuring out a way to filter the same data set twice in the one table.   I can give more specific info if you let me know what you need. Thanks!

Trouble Using More Than One LIKE Operator in a Table Filter in SSRS 2008

  

Hello All,

I'm having what I'm hoping will be a simple issue -

My co-worker has created a large report which contains several tables in SSRS 2008.  Each table is tied to one dataset, yet only certain data can be returned to each respective table.  Right now he's applying filters at the table-level behind each table, however as you can imagine this is not efficient because there is a LOT of data returning for this report. 

I'll try and give a simplified example -

There are two tables in the report body - one for containing products relating to both Cats and Dogs, and one for containing products relating to Birds.   Each product starts with the name of the specific animal - for example "Cats-Mouse Toy", "Dogs-Frisbee", "Birds-Rubber_Leaf".  

Now I need to somehow filter out each product so that they go to their proper tables.  As mentioned above, my co-worker was creating a specific filter for each product, but this is proving to be inefficient.  For example, there are 52 different products for Birds alone.  That would mean 52 different filter entries for each product.  What I would like to do is use the LIKE operator but i'm not getting the results I want on the first table.

So, on the first table I need something like:  =(Fields!Products.value LIKE &

Full text search not working for pre-existing data on table after installing docx filter.However wor

  

Hello All,

 

I have a strange issue. I have pre-existing data in my table with full text index defined along with catalog. I noticed that I did not have the docx filter ,so I installed the filter and performed the steps below. After installing the filter  I added a couple of new records. I noticed that the full text search pulled up the new records matching the criteria but did not return any pre-existing records. Could you please let me know the issue.Please note – currently I am using sql 2008 , but also would like to verify the same in sql 2005 as well.

Also could you please verify the steps below for installation in sql 2008 and sql 2005 and with different architectures (Eg windows 2003/2008, 32bit, 64 bit etc)

 

This was tested on VM image on 64 bit architecture Windows 200

Compare if every table entry exist at least once in other table

  

Hi

I have 2 tables:

- Salesmen with Pk.SalesmenID
- Appointments with Fk.SalesmenID and busy(bit)

I want to query:

If
(Every salesmen has at least one appointment)
Then
(Select non busy salesmen)
Else
(select * from salesmen)

Should I compare distinct counts of both tables?

Purpose is to get salesmens even if there's no appointment made yet. I hope it's somehow logic what I'm trying to explain here :-)


filter table data to report

  

hello,

I have a table which captures the updated data. I need to generate a report on updated fields.

Could you please tell me how to filter the updated data from the table to display in the report.

I'm new to this so i need the sql code or stored procedure to filter and show only the updated data.

 

Well I have time stamp as well as a column for last changed date.

 

i need to produce all the fields pertaining to the updated cell in a single cell of the report.

for instance i change the last name of the person - i need to produce the persons firsname , updated lastname, his address and other details in a single cell of a report.

 i also need to show the records in both ascending and decending way - like most recent update of the day and first update of the day.

so how do i code for this.

 

thank u for your help


Filter table data in sql

  

hello,

I have a table which captures the updated data. I need to generate a report on updated fields.

Could you please tell me how to filter the updated data from the table to display in the report.

I'm new to this so i need the sql code or stored procedure to filter and show only the updated data.

 update-----

 

Well I have time stamp as well as a column for last changed date.

 

i need to produce all the fields pertaining to the updated cell in a single cell of the report.

for instance i change the last name of the person - i need to produce the persons firsname , updated lastname, his address and other details in a single cell of a report.

 i also need to show the records in both ascending and decending way - like most recent update of the day and first update of the day.

so how do i code for this.

 

thank u for your help 

 

thanks

 

justin


filter the data from a table to a report

  

hello,

I have a table which captures the updated data. I need to generate a report on updated fields.

Could you please tell me how to filter the updated data from the table to display in the report.

I'm new to this so i need the sql code or stored procedure to filter and show only the updated data.

 

Well I have time stamp as well as a column for last changed date.

 

i need to produce all the fields pertaining to the updated cell in a single cell of the report.

for instance i change the last name of the person - i need to produce the persons firsname , updated lastname, his address and other details in a single cell of a report.

 i also need to show the records in both ascending and decending way - like most recent update of the day and first update of the day.

so how do i code for this.

 

thank u for your help


Find and compare values from a repating table?

  

Hi all

I am trying to loop through a repeating table, which is a secondary data source, and compare the Title column from the repeating table to another string which is not from the table. If they equal, I want all other rows to be hidden, except the equal one. I could do it easily in regular c#, but have not done it with InfoPath. I am not quite sure how to acheive that in InfoPath. If somebody could give me some sample code to put me in the right direction, I would be most thankful.

Regards.


any compare tool which will cater table rename script

  
Any compare tool which will cater table rename script.
what i have done in my application new version is rename about 6 table.
I am use to run the AdeptSQL Diff tool to get the upgrade script.
Now I am stuck with table renaming.I have also called that table names in number of stored procedure.
Is there any tool I can generate the upgrade script with table renaming?

Kamran Shahid Senior Software Engineer/Analyst (MCP,MCAD,MCSD.NET,MCTS,MCPD.net[web])

filter data in reapeating table

  

Hi all,

I created repeating table that retrieve data from share point list( Secondary data source),in this repeating table it display only one row(first selected row in list).I used conditional formatting to filter data.I need to display all the data in the repeating table where condition is true.Give me a solution for this.....

thanks......

 


How to filter data in repeating section using field value in repeating table?

  

Hi!

My form is web-browseable. I have a repeating table and repeating section in one of my form views. 

I want to filter data in my repeating section by field value in selected row in repeating table. How is it possible? How to fire event on row change in reapeating table? How to get value from field in selected row?

Actualy, it is the same data in these sections, but its a list with some fields in the reapeating table and all fields(details)  in reapiting section. I would like to filter data in repeating section by field DPNumber in repeating table.

 


Dynamic Column filter on table variable or temp table

  

Hi,

I created a  procedure which first populates a table variable /temp table with data. Then based on input parameter (say, @ColumnNames) I want to filter the result set.

Here is the snippet I have created, -

create PROCEDURE [dbo].[GetAlerts]
	@roleId varchar(20),
	@fields sysname
AS
BEGIN
declare @temp table(
	ID int,
	SOURCESYSTEMNO int ,
	role_id varchar(20),
	CRITICALINFO varchar(1000));

    insert into @temp select * from dbo.commonalertdata where role_id= @roleId);

	declare @sql varchar(300);
	set @sql='select ' + @fields + ' from @temp';
	exec dbo.sp_executesql @sql; 
END

Then i tried to run it as follows, -

exec dbo.GetAlerts 1 , 'SOURCESYSTEMNO, CRITICALINFO'

And It gave the following error.

Msg 1087, Level 15, State 2, Line 1

Must declare the table variable "@temp".

Now, I tried using table variable or temp table or even UDF with no good. Can anybody help me in getting dynamic columns from a calculated table valued result set like temp table / table variable / inline table valued UDF?


Filter data to compare value

  

Hello,
    I want to filter out one value in total like example bellow:

 

How filter data from a webservice that returns a table by comparing dates

  

I have an infopath form that takes in brings in an entire table and I want to filter it on datetime by comparing records from a time span of dates that have already been assigned.  I have tried everything from doing it from the within infopath using equations to filter the datasource and also doing it programmatically.  I am to the point where I think it has to be done programmically (C#).  Here is an example of the XPath code I was trying:

(xdMath:Avg(xdXDocument:GetDOM("ISSOrbits")/dfs:myFields/dfs:dataFields/d:ISSOrbits/@Apogee[(number(translate(xdXDocument:GetDOM("ISSOrbits")/dfs:myFields/dfs:dataFields/d:ISSOrbits/@StartTime, "T-:+", "")) >= number(translate(/my:myFields/my:MissionData/my:LaunchMissionDateTime, "T-:+", "")))]))

It seem that only the first record (node) from ISSOrbits gets compared and not the whole dataset.

Please show me how to do this programmatically in C# or if there is way to do it without code.

Thanks


Charles Picco

P.S. I forgot to mention that table is brought in through a webservice that cannot filter data.

 


Category Internet Sales Amount US Internet Sales Amount
Accessories $700,759.96 $256,422.07
Bikes $28,318,144.65 $8,999,859.53
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend