Joining Three Tables Returns Unnecessary Fields In Recordset
I have three tables in my db, joined together. The connection works fine, but I want to stop the first two tables from listing their info. for each call to the third table.
ex:
table 1 - page title, description
table 2- section title, description
table 3 - links, and their info.
For each page, there are mulitple sections and links, so I don't want the section title to appear each time I display a new link.
Here is my code:
View Replies
ADVERTISEMENT
i have an sql query that needs to join 3 tables to get the desired answercouldnt think of a better way )
Code:
SELECT *
FROM Sold INNER JOIN Serial
INNER JOIN TempSerial ON Serial.SerialNo=TempSerial.SerialNo
ON Sold.SoldID=Serial.SoldID
WHERE Sold.CustomerCode='"&customer&"';"
View Replies
View Related
When I do a join in asp to retreive data from two tables, should I have create two recordset, or just one is enough. I tried: Code:
Set RS = Server.CreateObject("ADODB.Recordset")
RS.Open "Table1", "Table2", Conn
Set RS = Conn.Execute(SQL)
I am getting an error Type Mismatch in line no. And the line no is the Recordset line.
View Replies
View Related
i have an sql query that needs to join 3 tables to get the desired answer(couldnt think of a better way ) i did this: code:
SELECT *
FROM Sold INNER JOIN Serial INNER JOIN TempSerial ON Serial.SerialNo=TempSerial.SerialNo
ON Sold.SoldID=Serial.SoldID
WHERE Sold.CustomerCode='"&customer&"';"
View Replies
View Related
I have a mailing list table where people can enter their details and choose to have information on a variety of subjects sent to them. The details are kept in one table, the subjects are kept in another. On our database maintenance page, I'd like to be able to print out how many records are associated with each subject. Code:
SQL = "SELECT D.subject,Count(D.ID) AS cntID FROM details D, subject S WHERE D.subject = S.subjID GROUP BY D.subject"
There are: <b><% = rs("cntID") %></b> records in the <% = rs("subject") %> mailing list.
This gives me nearly what I want, but instead of printing the table's name, it prints its corresponding numerical ID. I tried including the subject name in the query, but it's not part of the aggregate function, so it won't have it.
View Replies
View Related
i have an sql query that needs to join 3 tables to get the desired answer. i did this:
Code:
SELECT *
FROM Sold INNER JOIN Serial
INNER JOIN TempSerial ON Serial.SerialNo=TempSerial.SerialNo
ON Sold.SoldID=Serial.SoldID
WHERE Sold.CustomerCode='"&customer&"';"
but its not working.
View Replies
View Related
i have 3 tables how can i join these three tables using id_num primary key.
View Replies
View Related
I wanted to ask your opinion about *joining two tables* from *two different database* together. Is *that* possible My project requires me to join identical tables from different database; *eg. MyTable* from *Friends.mdb* and *Foes.mdb* respectively. Is that achievable? I do hope anyone here can enlighten me on this one because I am really a newbie in using Access DB and also I'm using *ASP* in this project.
View Replies
View Related
how would you join the two felds from a table in the database so it can show the image from joining the two fields to know wherethe image is coming from
Quote:
<img src="<%=(rs_lprojects.Fields.Item("image_folder_path").Value)%><%=(rs_lprojects.Fields.Item("image_src1").Value)%>" />
View Replies
View Related
What does ADO.RecordSet.Open return when the SQL query is an UPDATE or INSERT query?
View Replies
View Related
I would like to compare 2 tables, TableA and TableB
Both Table has FieldA, FieldB and FieldC
how do i compare the 3 fields in this two tables and list out records that the 2 tables fields does not tally? eg.
if TableA.FieldA != TableB.FieldB AND TableA.FieldB != TableB.FieldB AND TableA.FieldC != TableB.FieldC
View Replies
View Related
is it possible to dynamically add a field into a table? or add a table? Lets just say that I have a DB with 10,000 entries and about 5MB in size. I want to add a new feature and for this i need to add an extra field to the table. I don't want to d/l the DB, make the changes locally and then u/l again, so can I do it via script?
View Replies
View Related
I have 4 tables first table category (category_id and category name in it)
second table artist (artist_id, category_id, artistname in it)
third table album (id, artist_id, album_title in it)
forth table song (id, album_id, title in it)
I'm selecting category in first page
I'm selecting artist in second page
I'm selecting album in third page
I'm requesting, collecting and posting all id's to the next page.
this is the question!!
How can I read from database
1- category name when I was selected in first page
2- artist name when I was selected in second page
3- album name when I was selected in third page
View Replies
View Related
i have two tables:
Employee
TokenID (pk)
...
..
Rating
TokenID (pfk)
...
...
I want to display all fields from both tables ..
but TokenID should come once as it a foreign key in Rating table..
what would be the resultant query
View Replies
View Related
I have been trying to create a set of horse race results.The result of the race is one table and the breeding and owner details in the other table.I am using the horse name as the comon value in each table.the tables look something like this
table: result
pos1; horse name
pos2; horse name
etc.
table: names
horse name; horsename, sire; sire, dam; dam
horse name; horsename, sire; sire, dam; dam
Currently I am using a new record set for EVERY field position sorted by the horse name to bring up the related breeding for every positoin in the race field.
This mean for some races I am calling 16 seperate record sets.
View Replies
View Related
Does anyone know a good way of searching a recordset with joined tables and grouping the records (it's a one to many relationship) so that the fields belonging to the table with the primary key are only shown once?
So for example if I have a companies table and and offices table where a company can have multiple offices and I use a linked table to join the two. I need to be able to search both the company and office tables and I want my ASP to display: Code:
View Replies
View Related
I know how to loop around a recordset and put it into a table :
ASP Code:
<table border="1">
<tr>
<td>ID</td>
<td>Answer</td>
</tr>
<%Do while Not answerRecordset.eof%>
<tr align="center">
<td><%=answerRecordset("entryName")%></td>
</tr>
<% answerRecordset.MoveNext
Loop%>
</table>
But how would i loop around but instead of one massive column put the answers into 4 diferent columns
View Replies
View Related
I would like to create a recordset which joins 3 tables using the column 'productid' as the key column throughout. I want all the columns from all three tables with a where clause that says category = beau and subcategory = mirror. I have tried numerous things but I get one error message after another. Code:
View Replies
View Related
My database has customers, orders, and orderDetails tables. I'm trying to create a page that we can access to lookup all details about our orders. That page will need information from all of these tables.
How do I create a recordset that can handle the relationships and bring in all data?
View Replies
View Related
I have a problem concerning recordsets. I am using the ADODB command object to execute a database query. The query is then saved in a recordset.
Before my function returns the recordset I'd like to add an additional field to the recordset. However, this doesn't work: Code:
View Replies
View Related
I have a database that contains a release list for some products. It's constructed like this:
ID (autonumber)
ProductID (relatednumber)
Date - the date for release
Approx - (number related to text en other table = ApproxRelation)
ApproxYear - (number)
The Approx is a number related to antoher table containing the corresponding text - like "1st quarter", "January", "March" and so on.
I want to sort the release of the products by date, but then mix the sorting with the approximated dates. Like: Code:
View Replies
View Related
I would like to dulicate a selected record. Sounds easy enough like performing another INSERT operation. However, that solution only works if the datasource is only one table.
I have 4 different tables all linked to the main table through a unique primary key (auto number). When a user clicks a button to clone a record, all related records from the other tables must also be duplicated using the newly assigned ID that matches the one from the main table.
Hopefully I didn't confuse you. Consider it like a multi-step process of filling out different web-based forms but using the same unique id.
I don't know the first place to start on creating duplicate entries based on existing records. If you can start me with the code, I could probably follow the logic. THe difficult part for me to conceptualize is how to carry this new ID to all the other tables.
View Replies
View Related
I have a search option on my website, which should perform a search on 4 fields, as follows:
tblNews
headline
content
tblDatabank
filename
description
It only needs to return matches which are an exact match of their search criteria. For instance, searching for "I am here" would return a record which contained "I am here", but not just "I" or "I am" etc.
I need to return all these records as part of one recordset preferably, as I want to be able to order them etc., though I imagine you may suggest I use an array somehow to merge two recordets etc., then reorder them?
View Replies
View Related
How do I go about joining two variables to represent a new variable? Code:
View Replies
View Related
can i join many table like 3 or more table using SQL statement. Below is the 2 table join example:
Set DbConn =Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
Query = " SELECT poll_Questions.QuestionID, poll_Questions.p_Question, poll_Questions.p_StartDate, poll_Questions.p_EndDate, poll_Questions.p_Active, poll_Questions.p_PostedBy, poll_Answers.p_Answer"
Query = Query & " FROM poll_Questions INNER JOIN poll_Answers ON poll_Questions.QuestionID = poll_Answers.QuestionID"
rs.Open Query, DbConn
Do you guys know how to join 3 or more table rather than 2 table?
View Replies
View Related
How can i join a table if i don't have 2 matching fields. My problem is i need to pull info from my employee table and my program table there is a soldby1 column that has which employee sold the program but there is no matching fields in the employee and the program table. Code:
strSQL = "SELECT employee.id, program.cust_no , service.serv_code , servcd.servname ,service.price, service.servstatus, service.posted FROM customer inner join program on customer.cust_no = program.cust_no inner join service on program.prog_id = service.prog_id inner join servcd on service.serv_code = servcd.serv_code inner join employee where program.season = '2006' and service.servstatus <> 'N' and customer.cust_no = '" _
& Request.Form("username") & "' group by program.status, program.cust_no, service.serv_code, servcd.servname, service.price, service.servstatus, service.posted, customer.taxid1"
View Replies
View Related
I have these two statements and I want to join them to make one query, i don't know how to do it since there are two querystrings that are selecting my data for me.
sSQL = "SELECT * FROM AssemblyName Where AssemblyName = '" & Request.QueryString("assembly") & "'"
Set oRS = oConn.Execute(sSQL)
sSQL = "SELECT * FROM PartsList Where ID = '" & Request.QueryString("one") & "'"
Set oRS2 = oConn.Execute(sSQL)
View Replies
View Related
I want to run two queries on two seperate database tables and then combine the results - I'm sure this is possible with some sort of join command. Anyone know how to do this?
View Replies
View Related
I know how to create dynamic tables in dreamweaver to display fields and records in a table of a database, but in my case I need to create a dynamic table that lists all the tables in the database, then to click on the one i want 2 edit the data in there.
View Replies
View Related
i want to left join result sets together coming from two different databases based on a common field storenumber. They are separate databases as per management design.
Basically it should match rows based on the store number, those who don't have matches should display only the storenumber and no other info like: Code:
Store Q1 Q2 Q3 Q4
1 x x x x
2 x x x x
3 <--No data in 3, just display storenumber
4 x x x x
View Replies
View Related
I�ve got 2 recordsets, 1 called �special� and the other called �A55�
Special has a field called �Email_Address��.
A55� also has a field called �Email_Address��.
What I need to do is display all of the records in the recordset �A55� but only the records where the email address field is in the "special" recordset I am using ASP so is the solutions ASP or SQL and how is it done..
View Replies
View Related
I am trying to concatenate two recordsets but I have no idea how to do it.
Here is my little bit of code:
SQLQueryA = "SELECT * FROM mainCategories"
SQLQueryB = "SELECT * FROM subCategories"
Set RSA = OBJdbConnection.Execute(SQLQueryA)
Set RSB = OBJdbConnection.Execute(SQLQueryB)
How do I join RSA and RBS together to make a single recordset?
View Replies
View Related
I currently am posting data to another site with ASP and in return that site returns a page that is XML. How can I grab this data programatically?
This is what the returned page looks like:
<?xml version="1.0" encoding="UTF-8" ?>
- <!-- Turnitin API Return Data
-->
- <returndata>
<rmessage>Successful!</rmessage>
<originalityscore>92</originalityscore>
<rcode>61</rcode>
</returndata>
View Replies
View Related