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:

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
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
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

Similar Messages:

SQL Server :: Combine Two Rows Of Data?

Mar 9, 2011

have a complex sql stored procedure which involves several unions.The unions also involveat from views. When the data is returned, it might look like the following.

ProductId Name Amount Buyer Date YearsAsCustomer
1 Jones 234.44 Nichols
1 Jones 3/12/2011 3
2 Melon 333.00 Tripol
2 Melon 3/23/2011 4

This is just a simple example, but notice how the records with the same product Id can be combined?Because one record has some of the data I need and the other record has different data. So essentiallythey should just be in one record together. So the output should look like this:

ProductId Name Amount Buyer Date YearsAsCustomer
1 Jones 234.44 Nichols 3/12/2011 3
2 Melon 333.00 Tripol 3/23/2011 4

How can I combine these records together? In the stored procedure the query is build in a parameter stringnamed @SQL, and then the query is executed by using the EXEC command:EXEC sp_executesql @SQL.Is their anway I can combine all of the outputted records into one record. Where the records I want to combine
have the same ProductId (As in the example I illustrated above?)

View 7 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

Forms Data Controls :: How To Combine Some List Items Together

Jan 8, 2011

just want to have a quick question about the value of dropdownlist listitem. I have a gridview which has its datakey value linked to a dropdownlist. In the dropdownlist I have many listitems. So I decided to combine some list items together. Originally, the values of the items are 1,2,3,4,5,6,7,8. But I want to have only 5 items by combining 5,6,7,8 into one listitem called "Others." So if the listitem "Others" is selected, the gridview will show all the records that have value 5 or 6 or 7 or 8. Is it possible? How can that be done?

I hope I made myself clear. Any question, I am happy to clarify.

View 4 Replies

MVC :: How To Get Access To The Fields In Table B In The View

Feb 9, 2011

I do not know if this can be done but lets say have a model like the one below:

I am trying to do this:

<%= Html.RadioButtonFor(model => model.B.height)%> -----> Does not work. Height is not a property

But B is a collection. How do I get access to the fields in table B in the View?


Table A




Table B





View 14 Replies

Forms Data Controls :: Combine Gridview Columns Under One Column And In Separate Rows

Nov 29, 2010

I have a couple of things that are not working with my Gridview:

1) I've managed to display 3 columns in one column (see code above) but the data is separated by commas, how can I display each data item in separate rows.

2) How can I make the data unique, as I have added the distinct command which I configured in my SQL data source

3) I need the rows to not display nulls, but at the moment it isn't displaying the row if one of the columns is null?


View 3 Replies

DataSource Controls :: Convert Sql View To Access Table?

Mar 1, 2010

i have project using sql2005 as database. i want to convert the 1 View (or some of my table) to Access that admin can download it.

what is the easiest way to do that?

View 4 Replies

MVC :: How To Get Related Table Data / How To Access Groups Table Data From View

Mar 30, 2010

I have a strongly typed view for Contacts table In my index page , i am accessing the tables as --- "foreach (var item in Model)"

This table has an association with Groups Table

How can i access Groups table data from view.

intellisense gives me possibility to write like "item.Groups.GroupTitle"

But it returns null(object not initiated) How to solve this?

View 3 Replies

Access :: Reading Data From Access With A Linked Table (pointing To A Access Table On Another Location?

Sep 7, 2010

Here's a short explanation of my project.

1) the default page loads, it will read the Windows Login of the user opening the page.
2) I'll check if this login exists in a table stored on the webserver.

In this Access Database, there's a 2nd linked table, pointing to another access table on a network location. Now, I want to read data from this linked table. However, at this moment I receive an error:

"The Microsoft Jet database engine cannot open the file '\<ip><shared-folder>statistics.mdb'. It is already opened exclusively by another user, or you need permission to view its data".

Some extra info:

- The network folder has read and write permissions for everyone

- the user and group permissions on both access files are set to read/modify/administer for the Admin user (on the tables I want to read from)

- IIS authentication on the server is set to "Windows Authentication" (this is needed so I can read the Windows Login from the user). All other authentication modes are disables (like anonymous, ...)

- When the error occurs, no other program or process has access to the statistics.mdb (so, it can't be locked by someone else)

- the web.config files access connection string looks like:
<add name="AccessConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\<IP><shared-folder>statistics.mdb;User Id=admin; Password=;" />

Like I said before, in this statistics.mdb file, there are 2 tables. One normal table, and another linked table (pointing to a network location)

Searching for solutions, I discovered the following:

- if I don't use linked tables, everything works fine (however, I have to use this linked table)

- even if I connect directly to the table in the network I receive the error. So, I'm pretty sure I don't have sufficient rights to read from this table.

I read that not the Admin user is opening the file, but actually a user called ASP.NET. This user doesn't have the correct rights to do this. However, I'm not sure if this is true.

View 5 Replies

Combine Data From Multiple Tables Into One View Model

Dec 5, 2010

I'm fairly new to all this, but have slowly been teaching myself C# and MVC over the past year or so...I really tried to search for this, but haven't been able to find anything - it may be I'm using the wrong terminology!I'm using ASP.NET MVC2 with EF4 connected to a SQL Express db. Situation: Without getting into too much specifics, I have one table called 'Plan.' Under 'Plan' are several different categories that are related to a single Plan item [say Category A, Category B, Category C and Category D]. Each 'Category X' table has a beginDate, endDate and other details specific to that category.

I'd like to be able to create a summary page that combines all items from Category A, Category B, Category C, and Category D and sorts by beginDate - but only need a few of the columns [eg - begin/end date, name, id].

View 1 Replies

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

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?


View 12 Replies

SQL Server :: How To Combine Multiple Rows Into A Comma-delimited List In Sql Server In Build Function

Jan 10, 2011

How can I combine multiple rows into a comma-delimited list in sql server in build function?? in HCL

examples :


Output : 12, 15, 18, 20

with in build function of sql server.

View 6 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?


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

JQuery :: Loop Through Gridview Rows And Access Each Rows Element?

Dec 7, 2010

i have gridview and having few rows. each rows have checkbox,textbox,combo in each column. how can i loop through gridview using jquery and access each elements in rows in loop for collection the value at client side by jquery.

View 3 Replies

Visual Studio :: Items That Select In Design View Are Not Being Highlighted In Source View?

Sep 30, 2010

I'm using Visual Studio 2008, and when I select/highlight something in design view and switch to source view it does not highlight and scroll to the selected item. This makes it really hard to change stuff in source view, and it's very inconvenient at worst

View 2 Replies

Access :: Copy Access Table Data To Sql Server Table Programmatically?

Sep 23, 2010

Dim ds As New AccessDataSource

ds.DataFile = "c:InputTest.mdb"
ds.DataSourceMode = SqlDataSourceMode.DataSet [code]....

View 5 Replies

Access :: Use Sum Function In Access Database (not MS SQL) To Add Array Of Items In A Particular Date?

Aug 19, 2010

I want to use sum function in access database (not MS SQL) to add array of items in a particular date.For Eg. The Access Database format like

Prod. Name


View 4 Replies

Table That Has Some Columns And Rows Want This Table To Have Borders That Are Visible Inside It??

Sep 1, 2010

i have a table that has some columns and rows i want this table to have borders that are visible inside it i want every column an row to be closed in borders how can i do that?

View 1 Replies

AJAX :: Adding Table Rows At Specific Point In Table?

Dec 23, 2010

I have an asp:Table and around the mid point of the table there is a DDL with values 2-5. What I want to do is add the selected amount of rows using AJAX right after the table row that has the DDL in it. I know how to dynamicly crate the rows, the info in the rows, and how to use AJAX to make things. Problem is I can not put the ContentTemplate tag inbetween the asp:TableRow which would mark the location I want the dynamic rows to start being added. I did some searching on here but most posts I find start with making the table from code and not the asp:Table tag

View 2 Replies

SQL Server :: Delete Objects From Table Using Another Table To Select Rows?

Sep 14, 2010

I have one table named 'dbo.ac_Products' Within this table there is a column named 'ProductId' There is also another table named 'dbo.ac_CatalogNodes' Within this table there is a column named 'CatalogNodeId' and a column named 'CatalogNodeType'

I need to delete all the rows from 'dbo.ac_Products' and 'dbo.ac_CatalogNodes' where 'ProductId' = 'CatalogNodeId' and 'CatalogNodeType' = 1

View 4 Replies

Table For Theater Format / Create 10 Cloumns And 10 Rows In The Table?

Feb 1, 2011

how do create 10 cloumns and 10 rows in the table. The rows will came a1,a2....a10.

View 4 Replies

Web Forms :: Generate A Dynamic Table And Add Rows To A Table Control?

Mar 29, 2010

I am trying to generate a dynamic table andd add rows to a ASP.Net table control on my UI. My problem is as I add a new row from MyTable, in to another table the table I am copying from, will loose one row. Here is the code:

myTable = new


am just reading one row in every loop and add that row in to another table object, why is 'myTable' loosing loosing one row in each loop?

View 7 Replies

JQuery :: Delete Or Add Rows In A Table But Since The Table Is In An Update Panel?

Sep 18, 2010

I am trying to delete or add rows in a table but since the table is in an update panel,upon deletion the row goes away and then comes back.I have tried using return false but it does not seem to work in IE or FF.

I am using the following code:

$(document).ready(function () {
$(.table).click (function ()}


Basically I need a way to disable the postback.

View 5 Replies

Copyrights 2005-15, All rights reserved