DataSource Controls :: Combine Two Result Sets From One Table?

Jan 6, 2010

I have a table that contains a date column along with others. I need to extract two sets of data from this table for two different time periods. Call them Current and Previous, so that I can compare them line for line. There are exactly the same number of days in both time periods.

The problem is that I need to return the data like this:

CurrentDate, Count(CurrentItems), Sum(Amt), Count(PreviousItems), Sum(PrevAmt)

JOIN puts the data into the result vertically, so that doesn't work. So far, I have not found a method that will arrange the data correctly.

View 1 Replies


Similar Messages:

DataSource Controls :: Xsd And Stored Procedure With Multiple Result Sets

Jun 12, 2010

Just after some advice I have a stored procedure that returns several tables. I then need to loop through the tables and create dynamic gridviews using the data. At the moment this stored proc is called using

[Code]....

I have used an xsd file to populate everthing else, but due to this returning multiple tables i wasn't sure how this works should it just be in its own xsd? as all the oather i just get a datatable where as with this i need a dataset... how this makes sense...

View 2 Replies

DataSource Controls :: Stored Procedure With Multiple Result Sets - Binding To Gridview?

Feb 3, 2011

I am using a sql stored procedure which returns multiple result sets. By default Sql Datasource is binding the first result set to gridview. I want the second result set to be binded. I browsed all the properties in Sql datasource but could not find one to set this.

View 4 Replies

DataSource Controls :: Multiple Result Sets Vs Multiple Data Readers?

Jun 4, 2010

Would it be better to have a sp return multiple result sets and use NextResult() or have subsequent call to dr.execute.... () and hadle one result at a time?

To me using nextResult() on a multiresult datareader would be cleaner and easier - but it does not seem to be very "atomized". I guess I am wondering can the cost of executing multiple commands be neglected? Seems like executing multiple commands and receiving a single result set would also be easier to read/test/understand.

View 1 Replies

Better Performance To Query The DB Or Cache Small Result Sets?

Mar 14, 2011

Say I need to populate 4 or 5 dropdowns w/ items from a database. Each drop down will have < 15 items in it. These items almost never change.

Now I could query the DB each time the page is accessed or I could grab the values from a custom class that would check to see if they already exist in ASP.Net's cache and only if they don't query the DB to update the cache.

It's trivial for me to write but I'm unsure if the performace would be better or not. I think it would be (although not likely anything huge).

View 4 Replies

Forms Data Controls :: How To Bind Nested GridViews To Multiple Active Result Sets Data

Oct 7, 2010

I have a complicated report that nests six deep and so really hits the database hard. I want to use SqlDataReaders NOT DataAdapters and DataSets because I don't want big tables in memory.

MARS can get me the data fast, all from the one connection. But all the examples show it binding to a treeview.

I want to bind it to nested GridViews (six deep!).

Any examples of MARS binding to nested gridview/list/repeater controls of any kind?

View 1 Replies

SQL Reporting :: Two Charts In One Report With One Procedure Returning Two Result Sets?

Feb 18, 2010

I had requirement that i need to display four charts in one report. The data for the report is given through stored procedure. In this stored procedure each chart have its own result set. ie., the Stored Procedure is returning four result sets.

View 2 Replies

Forms Data Controls :: Combine Two Table From Database Into One Gridview?

Feb 18, 2010

i would like to know some of these:

how to combine two table from database into one gridview?

is it possible to add in a textbox into gridview?

why my checkbox is not showing in the gridview. this is the UI and the code. the UI display the data i retrieved from the database but why is the image and the checkbox not showing?

[Code]....

View 12 Replies

DataList Control - Combine Three Table Information Into Single Table

Apr 1, 2012

I have three table in my database they are ...

                             1. Category
                            2. Forum
                            3. Topic

I need to above three table information into a single table ...

View 1 Replies

DataSource Controls :: Merge Two Sets Of Data From A SqlDataAdapter And An OleDataAdapter And Then Populate A Gridview On A Button Click?

Jun 4, 2010

trying to merge two sets of data from a SqlDataAdapter and an OleDataAdapter and then populate a gridview on a button click. If I run just the SqldataAdapter on its own the grid populates as expected. This also applies to the OleDataAdapter. The problem arises when I try to merge the two. I get an empty table, hence dt3 is not populating. The code i'm using is below.Does anyone know why this doesn't work?

[Code]....

View 2 Replies

DataSource Controls :: Combine Data From 2 Tables

Mar 27, 2010

I have 2 tables with UserId and FirstName, LastName Columns that I want to combine the data in a Select Statement or Stored Procedure

1. The 2 tables will never have the same data, each table will be distinct

2. I want to combine first and lastnames to a full name (t1.FirstName + ' ' + t1.LastName) AS FullName

3. The statement will be used to populate a dropdownlist with UserId as Value, and Name as text

I am unsure how to accomplish this since I do not need to connect the tables, but combine the Sum of their data.

View 6 Replies

DataSource Controls :: Combine 2 Datatables From A Webservice?

Jun 23, 2010

The case is: I use a webservice that gives me information about companys. For example: I entered a companyname and the webservice give me a list of al company's in the country. The webservices return a one dimensional array. The problem is that I must search in two register so the webservices returns 2 array's. I put the data from both arrays into 2 datatables. The data in the 2 datatables can be different or the same.

The question is: How could I matching the data on ID and combine the data into 1 datatable.

The code:

//Create result
SearchResult Result1;
SearchResult resultZoekmogelijkheid2;
//send van Soap Request

[Code]....

View 7 Replies

DataSource Controls :: Statement To Combine Columns Of Different Tables

Feb 4, 2010

I have 2 tables and I want to entries of the tables into something like this:

Table 1: Table 2: End Result:
a 1 a - 1
b 2 a - 2
... ... b - 1
... ... b - 2
... ... ...

View 3 Replies

DataSource Controls :: Combine Multiple Columns Into One For Select Statement?

May 14, 2010

This question is for wrapping up work on a database driven AJAX AutoComplete Control that I am using to provide keyword hints to user on search pages. Each record has 6 columns for keywords where each column is for an advertiser to add a keyword. These are used in meta keywords tags, but I also want to use them for AutoComplete. The problem is that I don't know how to write a SELECT statement in Visual Studio that treats all 6 keyword columns as if they were all one column. I am looking for something like

SELECT (keyword1 + keyword2 + keyword3) AS Keywords
FROM (Merchandise)
WHERE Keywords LIKE @term

The only other thing I can think of the gain this level of functionality would be to combine them into a new table.

View 7 Replies

DataSource Controls :: Combine The LINQ Queries Together And Have Access To Both Of The Results Independently?

Feb 25, 2010

Is there a way to combine the LINQ queries together and have access to both of the results independently?

[Code]....

View 10 Replies

Forms Data Controls :: Copy Gridview Result To Another Table With VB?

Jan 20, 2010

I have an aspx webpage with a databound DropDownList and a databound GridView control. The GridView datasource is using a WHERE clause to return its' data. I.e. The user selects a work area from the DropDownList and members of that area appear in the Gridview. The GridView has 3 columns, WrkArea, LastName and FirstName. The page also has a Button.

What I am trying to accomplish is when the user clicks the Button, the data from the GridView is copied to a separate SQL table. I am working in VB. I have been looking at other posts but have to admit, I am really confused.

View 7 Replies

Data Controls :: Result In Pivot Table Shown To Gridview

Aug 21, 2012

I have a doubt and i am sending you the details  below, what i want to display in Gridview.

below i am describing the sql Table Structure.

Original Table Structure.

ID                Date             TimeLogged(Hrs)        UserName

1             10/8/2012               5.50                          Bubai
2             11/8/2012               2.30                          Bubai
3             10/8/2012               3.30                          Bhanu
4             11/8/2012               7.30                          Bhanu

I want result like below. User Name should be dynamic. May be lot of users. User name will come from Database table.

i want to show details in Gridview(Front End).

Date                    Bubai               Bhanu                    Total

10/8/2012              5.30                   3                         8. 30
11/8/2012              2.30                  7.30                       10

  Total                   8                    10.30                  18.30
 
I have a doubt and i am sending you the details below, what i want to display in Gridview. below i am describing the sql Table Structure.Original Table Structure.

ID Date TimeLogged(Hrs) UserName
1 10/8/2012 5.50 Bubai
2 11/8/2012 2.30 Bubai
3 10/8/2012 3.30 Bhanu
4 11/8/2012 7.30 Bhanu

I want result like below. User Name should be dynamic. May be lot of users. User name will come from Database table. i want to show details in Gridview(Front End).

Date Bubai Bhanu Total
10/8/2012 5.30 3 8. 30
11/8/2012 2.30 7.30 10

Total 8 10.30 18.30

View 1 Replies

Access :: Combine Items From Two Table Rows Into One View Row?

May 8, 2010

Working in Access, I need to create a view which takes values from two different records in another table and puts them on one row in the view. I'm having a hard time doing this since both row items come from the same field in the original table (actually in this case, using views instead of tables).

I have two queries I try to join together, but come up with the wrong results:
vwComp1:

SELECT q.CompStatus, q.EQID, c.CompsID, q.LastName, q.FirstNameFROM _EQ AS q, Comps AS cWHERE q.CompStatus=1 AND c.CompsID=q.CompID
vwComp2:
SELECT q.CompStatus, q.EQID, c.CompsID, q.LastName, q.FirstName
FROM _EQAS q, CompsAS c
WHERE q.CompStatus=2 AND c.CompsID=q.CompID
vwAssignment:
SELECT vwComp1.*, vwComp2.*
FROM vwComp1, vwComp2

This does fine in the vwComp2 part of vwAssignment, in the sense that it displays the correct name information, etc.; but for vwComp1, it just takes the name and other fields from the first row of vwComp1 and repeats it on every row of vwAssignment. This is really strange because vwComp1 and vwComp2, when displayed individually, each correctly puts the names in each row; something like this:

Bob White Rhonda Red
Bob White Freda Freschetta
Bob White Linda Lime
Bob White Jean Green

--when it should read something like this:
Bob White Rhonda Red
Fred Redd Freda Freschetta
Jim Brown Linda Lime
Rob Black Jean Green

View 1 Replies

DataSource Controls :: How To Bring The Particular Result Through Queries

Feb 11, 2010

(ie.)C-Chennai
B-Bombay
-Hydrabad
A-Andhra
K-Karnataka

It may comes any order but (cbhak) is constant. i need to bring this in query, i dont want to use any funtionHow can i acheive this result

View 2 Replies

DataSource Controls :: How To Bring The Result Without Using Cursor

May 13, 2010

Tag TableName FieldNameabc wc s_namelbl wc s_deslb2 wc s_prodin above fieldname(s_name,s_des,s_prod) column represent field in wc table.How can i bring this result. is this possible without using cursor. i was struggling past two days. i cant able to bring result for above.

View 17 Replies

DataSource Controls :: How To Get Result With Decimal Places

Jan 29, 2010

How can I get the result with decimal place? The following will return 33.00, but how can I get the result of 33.33?

[Code]....

View 2 Replies

DataSource Controls :: Get Itmcod Wise Result In 1 Row?

Feb 4, 2010

Table: ITMLED

Recsno itmcod opeqty inwqty isuqty
6200 001 500 NULL NULL
442 001 NULL NULL 100
22 001 NULL 700 NULL
23 001 NULL 500 NULL
443 001 NULL NULL 400

How do I get itmcod wise result in 1 row like

ITMCOD, OPNQTY, INWQTY, ISUQTY, ((OPNQTY+ INWQT) - ISUQTY) AS CLOSINGQTY
001 500 1200 500 1200

From above data in ITMLED.

View 4 Replies

DataSource Controls :: Want To Display Result Even If One Value Is Just Present?

Jun 4, 2010

How can I do this? I want to display result even if one value is just present. I've tried messing with the logical operators but still can't get it. Here is my SelectCommand.

[Code]....

View 10 Replies

SQL Reporting :: How To Combine Two Table In A Database To Create A Single Report In SSRS 2008

Jan 12, 2011

How to combine two table in a database to create a single report. For example I am having two tables in a database linked each other by means of primary and foreign key I cant able to combine these two tables while designing in aspx window. I can able to combine in .rdl file that is normal ssrs, when coming here (.rdlc) I cant able to combine the two tables. I am using VS2008 and SQL2008.

View 5 Replies

DataSource Controls :: Write SQL Query Result To Label

Mar 22, 2010

I have the following code which writes to a Gridview:

[Code]....

Using the same methods of connecting to the database, how can I amend this code to write the result of a second query (which only returns a number) to a label?

View 11 Replies







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